I have this code which takes short words (4 letter words in this case) and breaks them into two (or optionally 3) pieces, and then generates words from those parts.
const words = load()
const derivations = words.map(w => analyze(words, w))
console.log(derivations
.filter(({ list }) => list.length)
.map(({ word, list }) => `${word} => ${list.map(x => `\n ${x.join(':')}`).join('')}`).join('\n')
)
function analyze(words, word, listSize = 2) {
const derivations = []
const permutations = permute([], [], word)
permutations.forEach(list => {
if (list.length !== listSize) return
resolve(words, list[0], list.slice(1)).forEach(derivation => {
if (derivation.length) {
derivations.push(derivation)
}
})
})
return { word, list: derivations }
}
function resolve(words, chunk, remainingList, isFirst = true, result = []) {
words.forEach(word => {
if (!word.match(/^[aeiou]/) && word.length === 4 && (word.startsWith(chunk)) && word !== chunk && word !== [chunk].concat(remainingList).join('')) {
if (remainingList.length) {
resolve(words, remainingList[0], remainingList.slice(1), false).forEach(array => {
if (word !== array[0]) {
result.push([word].concat(array))
}
})
} else {
result.push([ word ])
}
}
})
return result
}
// https://stackoverflow.com/questions/34468474/make-all-possible-combos-in-a-string-of-numbers-with-split-in-javascript
function permute(result, left, right) {
result.push(left.concat(right));
if (right.length > 1) {
for(var i = 1; i < right.length; i++) {
permute(result, left.concat(right.substring(0, i)), right.substring(i));
}
}
return result;
}
function load() {
return `arch
back
bait
bake
ball
band
bank
bark
base
bash
bead
bear
beat
bell
belt
bend
best
bike
bill
bind
bird
bite
blob
blot
blow
blue
blur
boat
bolt
bond
book
boom
boot
boss
bowl
brew
brim
buck
buff
bulb
bulk
bull
bunk
burn
bush
bust
buzz
cake
call
calm
cane
card
care
cart
case
cash
cast
cave
char
chat
chew
chow
cite
clam
claw
clue
coal
coat
code
coin
comb
cone
cook
cool
cord
cork
cost
crab
crew
crib
crow
cube
cuff
cull
cure
curl
dare
dart
dash
date
daub
dawn
daze
deck
deed
dent
dice
diff
dish
disk
dive
dock
dole
doll
doom
dose
down
draw
drum
duck
duct
dude
duel
duke
dunk
dusk
dust
ease
etch
face
fade
fake
fare
farm
fast
fate
fawn
fear
feed
feel
file
fill
film
find
fine
fish
fizz
flat
flaw
flex
flow
flux
foam
fold
fool
fork
form
foul
free
fret
fuel
fume
fuse
fuss
fuzz
hack
haft
halt
hand
hare
harm
hash
haul
have
hawk
haze
head
heat
herd
hide
hike
hill
hint
hiss
hive
hold
hole
home
honk
hood
hoof
hook
hoot
horn
hose
host
howl
huff
hunt
hurt
hush
inch
keel
kern
kick
kill
kiln
kink
kiss
kite
knee
knit
knot
lace
lack
lake
land
lash
laze
lead
leaf
leak
lick
like
line
link
lint
list
load
loaf
loan
lock
look
loom
loot
lord
love
lull
lure
make
mark
mash
mask
mass
mate
maze
mean
meet
melt
mesh
mess
milk
mill
mime
mind
mine
mint
miss
mist
moan
mock
mold
molt
moon
moss
move
muse
mush
must
name
need
nerd
nest
nick
nose
note
null
oink
ooze
race
rack
raft
rake
rank
rant
rate
rave
read
reek
reel
rent
rest
ride
riff
rift
rise
risk
roar
robe
rock
role
roll
room
rose
rule
rush
rust
sack
salt
save
scam
scan
scar
seam
seat
seed
seek
self
sell
shed
shim
shoe
show
side
sift
silt
sink
site
size
skew
skid
skim
skin
slab
slam
sled
slot
snow
soak
sole
soot
sort
star
stem
stew
stir
stub
suck
suit
surf
swan
swim
take
talk
task
team
tear
tell
term
test
text
thaw
thud
tick
tide
tilt
time
toke
toll
tone
tool
toot
toss
tote
tour
tree
trek
trim
trot
tube
tuck
tune
turn
twin
vibe
view
void
vote
waft
wait
wake
walk
wall
want
wash
wave
wear
weed
weld
well
will
wind
wink
wish
wolf
word
work
worm
zone
zoom`.split(/\n+/)
}
Its output as you can see is like this for debugging purposes:
bake =>
back:keel
back:kern
bait:keel
bait:kern
ball:keel
ball:kern
band:keel
band:kern
bank:keel
bank:kern
bark:keel
bark:kern
base:keel
base:kern
bash:keel
bash:kern
band =>
bank:dare
bank:dart
bank:dash
bank:date
bank:daub
bank:dawn
bank:daze
bank:deck
bank:deed
You'll notice that sometimes over 20 words on the left appear (nested, like bank 20+ times). There are only 400 some words, but the combinations number over 8000. If I have a list of 10,000 words, and longer words, and variable number of breakdowns instead of just 2 parts, it grows to enormous proportions.
What if I wanted to store every one of those derivations in a relational database? First, would a relational database be effective in this scenario? Two, what is a standard data structure which could efficiently represent this, in terms of size (sometimes my solution runs out of memory), and disk storage size if it were a DB. I can break these conceptually into models, such as the "Word" model and the "WordDerivation" model, etc.. But if they were each tables, there would be potentially tens of millions of rows just for this. How does a robust company implement such a thing like perhaps Google?
Currently I am trying to work on the data model side of an app side project. I want to show a word, and have it list the derivations for the word. A naive solution would be to search a 100,000 word list for potential matches on every request, but that is basically what I am precomputing here and it takes some time. So I am wondering how you might break it down for a database.
I am used to Rails model, but they seem quite heavy in this scenario, I am not sure. I would need Gigabytes to store this it seems like.
I am creating a very naive AI (it maybe shouldn't even be called an AI, as it just tests out a lot of possibilites and picks the best one for him), for a board game I am making. This is to simplify the amount of manual tests I will need to do to balance the game.
The AI is playing alone, doing the following things: in each turn, the AI, playing with one of the heroes, attacks one of the max 9 monsters on the battlefield. His goal is to finish the battle as fast as possible (in the least amount of turns) and with the fewest amount of monster activations.
To achieve this, I've implemented a think ahead algorithm for the AI, where instead of performing the best possible move at the moment, he selects a move, based on the possible outcome of future moves of other heroes. This is the code snippet where he does this, it is written in PHP:
/** Perform think ahead moves
*
* #params int $thinkAheadLeft (the number of think ahead moves left)
* #params int $innerIterator (the iterator for the move)
* #params array $performedMoves (the moves performed so far)
* #param Battlefield $originalBattlefield (the previous state of the Battlefield)
*/
public function performThinkAheadMoves($thinkAheadLeft, $innerIterator, $performedMoves, $originalBattlefield, $tabs) {
if ($thinkAheadLeft == 0) return $this->quantify($originalBattlefield);
$nextThinkAhead = $thinkAheadLeft-1;
$moves = $this->getPossibleHeroMoves($innerIterator, $performedMoves);
$Hero = $this->getHero($innerIterator);
$innerIterator++;
$nextInnerIterator = $innerIterator;
foreach ($moves as $moveid => $move) {
$performedUpFar = $performedMoves;
$performedUpFar[] = $move;
$attack = $Hero->getAttack($move['attackid']);
$monsters = array();
foreach ($move['targets'] as $monsterid) $monsters[] = $originalBattlefield->getMonster($monsterid)->getName();
if (self::$debug) echo $tabs . "Testing sub move of " . $Hero->Name. ": $moveid of " . count($moves) . " (Think Ahead: $thinkAheadLeft | InnerIterator: $innerIterator)\n";
$moves[$moveid]['battlefield']['after']->performMove($move);
if (!$moves[$moveid]['battlefield']['after']->isBattleFinished()) {
if ($innerIterator == count($this->Heroes)) {
$moves[$moveid]['battlefield']['after']->performCleanup();
$nextInnerIterator = 0;
}
$moves[$moveid]['quantify'] = $moves[$moveid]['battlefield']['after']->performThinkAheadMoves($nextThinkAhead, $nextInnerIterator, $performedUpFar, $originalBattlefield, $tabs."\t", $numberOfCombinations);
} else $moves[$moveid]['quantify'] = $moves[$moveid]['battlefield']['after']->quantify($originalBattlefield);
}
usort($moves, function($a, $b) {
if ($a['quantify'] === $b['quantify']) return 0;
else return ($a['quantify'] > $b['quantify']) ? -1 : 1;
});
return $moves[0]['quantify'];
}
What this does is that it recursively checks future moves, until the $thinkAheadleft value is reached, OR until a solution was found (ie, all monsters were defeated). When it reaches it's exit parameter, it calculates the state of the battlefield, compared to the $originalBattlefield (the battlefield state before the first move). The calculation is made in the following way:
/** Quantify the current state of the battlefield
*
* #param Battlefield $originalBattlefield (the original battlefield)
*
* returns int (returns an integer with the battlefield quantification)
*/
public function quantify(Battlefield $originalBattlefield) {
$points = 0;
foreach ($originalBattlefield->Monsters as $originalMonsterId => $OriginalMonster) {
$CurrentMonster = $this->getMonster($originalMonsterId);
$monsterActivated = $CurrentMonster->getActivations() - $OriginalMonster->getActivations();
$points+=$monsterActivated*($this->quantifications['activations'] + $this->quantifications['activationsPenalty']);
if ($CurrentMonster->isDead()) $points+=$this->quantifications['monsterKilled']*$CurrentMonster->Priority;
else {
$enragePenalty = floor($this->quantifications['activations'] * (($CurrentMonster->Enrage['max'] - $CurrentMonster->Enrage['left'])/$CurrentMonster->Enrage['max']));
$points+=($OriginalMonster->Health['left'] - $CurrentMonster->Health['left']) * $this->quantifications['health'];
$points+=(($CurrentMonster->Enrage['max'] - $CurrentMonster->Enrage['left']))*$enragePenalty;
}
}
return $points;
}
When quantifying some things net positive points, some net negative points to the state. What the AI is doing, is, that instead of using the points calculated after his current move to decide which move to take, he uses the points calculated after the think ahead portion, and selecting a move based on the possible moves of the other heroes.
Basically, what the AI is doing, is saying that it isn't the best option at the moment, to attack Monster 1, but IF the other heroes will do this-and-this actions, in the long run, this will be the best outcome.
After selecting a move, the AI performs a single move with the hero, and then repeats the process for the next hero, calculating with +1 moves.
ISSUE: My issue is, that I was presuming, that an AI, that 'thinks ahead' 3-4 moves, should find a better solution than an AI that only performs the best possible move at the moment. But my test cases show differently, in some cases, an AI, that is not using the think ahead option, ie only plays the best possible move at the moment, beats an AI that is thinking ahead 1 single move. Sometimes, the AI that thinks ahead only 3 moves, beats an AI that thinks ahead 4 or 5 moves. Why is this happening? Is my presumption incorrect? If so, why is that? Am I using wrong numbers for weights? I was investigating this, and run a test, to automatically calculate the weights to use, with testing an interval of possible weights, and trying to use the best outcome (ie, the ones, which yield the least number of turns and/or the least number of activations), yet the problem I've described above, still persists with those weights also.
I am limited to a 5 move think ahead with the current version of my script, as with any larger think ahead number, the script gets REALLY slow (with 5 think ahead, it finds a solution in roughly 4 minutes, but with 6 think ahead, it didn't even find the first possible move in 6 hours)
HOW THE FIGHT WORKS: The fight works in the following way: a number of heroes (2-4) controlled by the AI, each having a number of different attacks (1-x), which can be used once or multiple times in a combat, are attacking a number of monsters (1-9). Based on the values of the attack, the monsters lose health, until they die. After each attack, the attacked monster gets enraged if he didn't die, and after each heroes performed a move, all monsters get enraged. When the monsters reach their enrage limit, they activate.
DISCLAIMER: I know that PHP is not the language to use for this kind of operation, but as this is only an in-house project, I've preferred to sacrifice speed, to be able to code this as fast as possible, in my native programming language.
UPDATE: The quantifications that we currently use look something like this:
$Battlefield->setQuantification(array(
'health' => 16,
'monsterKilled' => 86,
'activations' => -46,
'activationsPenalty' => -10
));
If there is randomness in your game, then anything can happen. Pointing that out since it's just not clear from the materials you have posted here.
If there is no randomness and the actors can see the full state of the game, then a longer look-ahead absolutely should perform better. When it does not, it is a clear indication that your evaluation function is providing incorrect estimates of the value of a state.
In looking at your code, the values of your quantifications are not listed and in your simulation it looks like you just have the same player make moves repeatedly without considering the possible actions of the other actors. You need to run a full simulation, step by step in order to produce accurate future states and you need to look at the value estimates of the varying states to see if you agree with them, and make adjustments to your quantifications accordingly.
An alternative way to frame the problem of estimating value is to explicitly predict your chances of winning the round as a percentage on a scale of 0.0 to 1.0 and then choose the move that gives you the highest chance of winning. Calculating the damage done and number of monsters killed so far doesn't tell you much about how much you have left to do in order to win the game.
I have been struggling badly with this challenge my lecturer has provided. I have programmed the files that set up the class needed for this solution but I have no idea how to implement it, here is the class in question were I need to add the algorithm.
#include "Solver.h"
int* Solver::findNumPaths(const MazeCollection& mazeCollection)
{
int *numPaths = new int[mazeCollection.NUM_MAZES];
return numPaths;
}
and here is the problem description we have been provided. does anybody know how to implement this or set me on the right track, Thank you!
00C, we need your help again.
Angry with being thwarted, the diabolically evil mastermind Dr Russello Kane has unleashed a scurry of heavy-armed squirrels to attack the BCB and eliminate all the delightfully beautiful and intellectual superior computing students.
We need to respond to this threat at short notice and have plans to partially barricade the foyer of the BCB. The gun-toting squirrels will enter the BCB at square [1,1] and rush towards the exit shown at [10,10].
A square that is barricaded is impassable to the furry rodents. Importantly, the squirrel bloodlust is such that they will only ever move towards the exit – either moving one square to the right, or one square down. The squirrels will never move up or to the left, even if a barricade is blocking their approach.
Our boffins need to run a large number of tests to determine how barricade placement will impede the movement of the squirrels. In each test, a number of squares will be barricaded and you must determine the total number of different paths from the start to the exit (adhering to the squirrel movement patterns noted above).
A number of our boffins have been heard to mumble something incoherent about a recursive counting algorithm, others about the linkage between recursion and iteration, but I’m sure, OOC, you know better than to be distracted by misleading advice.
Start w/ the obvious:
int count = 0;
void countPaths( x, y ) {
if ( x==10 && y==10 ) {
count++;
return;
}
if ( can-move-right )
countPaths( x+1, y );
if ( can-mopve-down )
countPaths( x, y+1 );
}
Start by calling countPaths(0,0).
Not the most efficient by a long shot, but it'll work. Then look for ways to optimize (for example, you end up re-computing paths from the squares close to the goal a LOT -- reducing that work could make a big difference).
I am trying to to load a JSON store with data that I am retrieving from a search server (Solr).
In Firebug, I can see the response (Solr returns data) but I cannot get the store to be loaded with the incoming data.
Notice that I am working locally (solr's address: localhost:8080/blah/blah and my app's address: localhost:8500/blah/blah).
My store code:
Ext.define('Ledger.store.Searchstore', {
extend: 'Ext.data.Store',
requires: ['Ledger.model.Searchmodel'],
model: 'Ledger.model.Searchmodel',
fields: [
{name:'id', mapping:'id'},
{name: 'model', mapping: 'title'},
{name: 'firstname', mapping: 'firstname'},
{name: 'lastname', mapping: 'lastname'},
{name: 'title', mapping: 'title'},
{name: 'biog', mapping: 'biog'}
],
autoLoad: true,
proxy: {
type:'jsonp',
url: 'http://127.0.0.1:8080/solr/select/?q=*:*&fq=model:book&wt=json',
//noCache: false,
//actionMethods:{create: "POST", read: "POST", update: "POST", destroy: "POST"},
//callbackKey: 'myCallback',
reader:{
type: 'json',
root: 'response.docs'
}
}
});
My model code:
Ext.define('Ledger.model.Searchmodel',{
extend:'Ext.data.Model',
fields:[
{name:'id', mapping:'id'},
{name: 'model', mapping: 'title'},
{name: 'firstname', mapping: 'firstname'},
{name: 'lastname', mapping: 'lastname'},
{name: 'title', mapping: 'title'},
{name: 'biog', mapping: 'biog'}
]
});
The incoming JSON from search server (it is valid):
{
"responseHeader":{
"status":0,
"QTime":1,
"params":{
"indent":"on",
"q":"*:*",
"wt":"json",
"fq":"model:book"}},
"response":{"numFound":8,"start":0,"docs":[
{
"id":"1",
"last_modified":"2012-05-12 15:33:07.0",
"model":"book",
"title":"The Art of Fielding: A Novel",
"fake_id":"b_1",
"biog":"At Westish College, a small school on the shore of Lake Michigan, baseball star Henry Skrimshander seems destined for big league stardom. But when a routine throw goes disastrously off course, the fates of five people are upended.\nHenry's fight against self-doubt threatens to ruin his future. College president Guert Affenlight, a longtime bachelor, has fallen unexpectedly and helplessly in love. Owen Dunne, Henry's gay roommate and teammate, becomes caught up in a dangerous affair. Mike Schwartz, the Harpooners' team captain and Henry's best friend, realizes he has guided Henry's career at the expense of his own. And Pella Affenlight, Guert's daughter, returns to Westish after escaping an ill-fated marriage, determined to start a new life.\nAs the season counts down to its climactic final game, these five are forced to confront their deepest hopes, anxieties, and secrets. In the process they forge new bonds, and help one another find their true paths. Written with boundless intelligence and filled with the tenderness of youth, The Art of Fielding is an expansive, warmhearted novel about ambition and its limits, about family and friendship and love, and about commitment--to oneself and to others.\t\t\t\t\t"},
{
"id":"2",
"last_modified":"2012-05-12 15:33:55.0",
"model":"book",
"title":"The Tiger's Wife",
"fake_id":"b_2",
"biog":"Starred Review. The sometimes crushing power of myth, story, and memory is explored in the brilliant debut of Obreht, the youngest of the New Yorker's 20-under-40. Natalia Stefanovi, a doctor living (and, in between suspensions, practicing) in an unnamed country that's a ringer for Obreht's native Croatia, crosses the border in search of answers about the death of her beloved grandfather, who raised her on tales from the village he grew up in, and where, following German bombardment in 1941, a tiger escaped from the zoo in a nearby city and befriended a mysterious deaf-mute woman. The evolving story of the tiger's wife, as the deaf-mute becomes known, forms one of three strands that sustain the novel, the other two being Natalia's efforts to care for orphans and a wayward family who, to lift a curse, are searching for the bones of a long-dead relative; and several of her grandfather's stories about Gavran Gailé, the deathless man, whose appearances coincide with catastrophe and who may hold the key to all the stories that ensnare Natalia. Obreht is an expert at depicting history through aftermath, people through the love they inspire, and place through the stories that endure; the reflected world she creates is both immediately recognizable and a legend in its own right. Obreht is talented far beyond her years, and her unsentimental faith in language, dream, and memory is a pleasure."},
{
"id":"3",
"last_modified":"2012-05-12 15:34:00.0",
"model":"book",
"title":"State of Wonder",
"fake_id":"b_3",
"biog":"In State of Wonder, pharmaceutical researcher Dr. Marina Singh sets off into the Amazon jungle to find the remains and effects of a colleague who recently died under somewhat mysterious circumstances. But first she must locate Dr. Anneck Swenson, a renowned gynecologist who has spent years looking at the reproductive habits of a local tribe where women can conceive well into their middle ages and beyond. Eccentric and notoriously tough, Swenson is paid to find the key to this longstanding childbearing ability by the same company for which Dr. Singh works. Yet that isn’t their only connection: both have an overlapping professional past that Dr. Singh has long tried to forget. In finding her former mentor, Dr. Singh must face her own disappointments and regrets, along with the jungle’s unforgiving humidity and insects, making State of Wonder a multi-layered atmospheric novel that is hard to put down. Indeed, Patchett solidifies her well-deserved place as one of today’s master storytellers. Emotional, vivid, and a work of literature that will surely resonate with readers in the weeks and months to come, State of Wonder truly is a thing of beauty and mystery, much like the Amazon jungle itself."},
{
"id":"4",
"last_modified":"2012-05-12 15:34:05.0",
"model":"book",
"title":"The Marriage Plot",
"fake_id":"b_4",
"biog":"A stunning novel—erudite, compassionate and penetrating in its analysis of love relationships. Eugenides focuses primarily on three characters, who all graduate from Brown in 1982. One of the pieces of this triangle is Madeleine Hanna, who finds herself somewhat embarrassed to have emerged from a “normal” household in New Jersey (though we later find out the normality of her upbringing is only relative). She becomes enamored with Leonard, a brilliant but moody student, in their Semiotics course, one of the texts being, ironically, Roland Barthes’ A Lover’s Discourse, which Madeleine finds disturbingly problematic in helping her figure out her own love relationship. We discover that Leonard had been diagnosed with bipolar disorder during his first year at Brown, and his struggle with mood swings throughout the novel is both titanic and tender. The third major player is Mitchell, a Religious Studies major who is also attracted to Madeleine but whose reticence she finds both disturbing and incomprehensible. On graduation day, Leonard has a breakdown and is hospitalized in a mental-health ward, and Madeleine shows her commitment by skipping the festivities and seeking him out. After graduation, Leonard and Madeleine live together when Leonard gets an internship at a biology lab on Cape Cod, and the spring after graduation they marry, when Leonard is able to get his mood swings under temporary control. Meanwhile Mitchell, who takes his major seriously, travels to India seeking a path—and briefly finds one when he volunteers to work with the dying in Calcutta. But Mitchell’s road to self-discovery eventually returns him to the States—and opens another opportunity for love that complicates Madeleine’s life. "},
{
"id":"5",
"last_modified":"2012-05-12 15:34:07.0",
"model":"book",
"title":"Steve Jobs",
"fake_id":"b_5",
"biog":"Based on more than forty interviews with Jobs conducted over two years—as well as interviews with more than a hundred family members, friends, adversaries, competitors, and colleagues—Walter Isaacson has written a riveting story of the roller-coaster life and searingly intense personality of a creative entrepreneur whose passion for perfection and ferocious drive revolutionized six industries: personal computers, animated movies, music, phones, tablet computing, and digital publishing.\r\nAt a time when America is seeking ways to sustain its innovative edge, and when societies around the world are trying to build digital-age economies, Jobs stands as the ultimate icon of inventiveness and applied imagination. He knew that the best way to create value in the twenty-first century was to connect creativity with technology. He built a company where leaps of the imagination were combined with remarkable feats of engineering.\nAlthough Jobs cooperated with this book, he asked for no control over what was written nor even the right to read it before it was published. He put nothing off-limits. He encouraged the people he knew to speak honestly. And Jobs speaks candidly, sometimes brutally so, about the people he worked with and competed against. His friends, foes, and colleagues provide an unvarnished view of the passions, perfectionism, obsessions, artistry, devilry, and compulsion for control that shaped his approach to business and the innovative products that resulted.\nDriven by demons, Jobs could drive those around him to fury and despair. But his personality and products were interrelated, just as Apple’s hardware and software tended to be, as if part of an integrated system. His tale is instructive and cautionary, filled with lessons about innovation, character, leadership, and values."},
{
"id":"6",
"last_modified":"2012-05-12 15:34:10.0",
"model":"book",
"title":"The Mill River Recluse",
"fake_id":"b_6",
"biog":"Having been loaned a Kindle from a friend, I immediately went in search of books that were inexpensive. I stumbled on The Mill River Recluse and the reviews were what made me really want to read this book. Having never written a review before, when I completed this book I felt I HAD to write a review. I was so wonderfully surprised to the depth of characters, storylines and twists and turns along the way. I stayed up all night just to finish it!! I found myself chuckling at times and caught myself off guard with tears rolling down my face. You became part of Mill River and its community almost from the first page. I really didn't want the story to end.\nIf you have only one chance to read a good Kindle book - this is by far the one! I enjoyed it so much, that when I someday purchase my own Kindle, I will be adding (and most likely reading) this book again....one I DEFINATELY want to add to a 'forever' collection!"},
{
"id":"7",
"last_modified":"2012-05-12 15:34:13.0",
"model":"book",
"title":"Chasing Amanda",
"fake_id":"b_7",
"biog":"In \"Chasing Amanda\" Melissa Foster guides us in helping Molly; wife, mother to a teenage son, search for a missing girl. The young girl has disappeared from their quiet, rural community; a place where things like this simply don't happen. For Molly, it's deja vu. Several years earlier, while living in Philadelphia, she witnessed a similar event. She did nothing at that time, and has been tormented by her inaction ever since.\nMolly's special gift, or curse, is her clairvoyance. She can sometimes 'see' things that others cannot. In Philadelphia, she failed the little girl, whose body was found shortly after. Now, she promised herself that she would not make that mistake again. Molly persists, using her clairvoyance and sheer stubbornness in an effort to find the child. In doing so, Molly exposes her town's shameful secrets, presenting a conclusion to this story, that I never saw coming!\nMelissa Foster's skill with her characters, drew me into the story immediately. The suspense that followed made this book a definite page-turner!"},
{
"id":"13",
"last_modified":"2012-05-12 16:08:48.0",
"model":"book",
"title":"Kodokan Judo",
"fake_id":"b_13",
"biog":"Judo, or the Way of Gentleness, an ideal form of physical exercise and a reliable system, of self-defense, was specially created from traditional Japanese martial arts. This book by the creator of Kodokan judo is uniquely comprehensive and the most authoritative guide to this martial art ever published.\r\nOver a hundred years ago Jigoro Kano mastered swordsmanship and hand-to-hand combat. Failing to discover any underlying principle, he set about designing a new martial art to reflect the concept of maximum efficiency in the use of physical and mental energy. Today, the concepts and techniques of judo taught at the Kodokan are the ones originally devised by their creator and collected together in this book. Covering everything from the fundamental techniques to prearranged formal exercises for both men and women, the book offers detailed explanations of how techniques are combined in two types of practice: randori (free practice) and kata (the practice of forms). In addition to a discussion of traditional methods of resuscitation, the book concludes with a useful appendix of information on the founder and the Kodokan International Judo Center, and a glossary of judo terminology. Fully illustrated throughout, Kodokan Judo will help students and instructors everywhere to discover the principles, techniques, and spirit of this popular martial art."}]
}}
Somewhere I have a button in order to "console.log" the store, but when I call (notice that I have set autoload attribute to true in the store definition) it is empty. When I am loading the above JSON (copy the server's response in a JSON file) via AJAX proxy, the store gets loaded with the data.
What is the problem?
Try this few things.
First one set proxy into model not into store. I had same problem for long time. Then try to reload ur app.
Second set root "docs" directly.
Third set a Ledger.store.Searchstore.load();
At last i used a proxy like this one and i left to my php file how to read remote file:
proxy: {
type: 'ajax',
api: {
read: 'scripts/receive.php',
create: 'scripts/create.php?action=create',
update: 'scripts/create.php?action=update',
destroy:'scripts/destroy.php?action=destroy'
},
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I try to make an survey/history of all C-to-hardware compilers.
For all that dont know them: they take C code then translate it into some hardware description language (like VHDL or Verilog), which then can be used to generate hardware (usually it gets mapped to an FPGA - but I am not limited to that, ASIC as target would be fine too).
I already have quite collected some (+ info about them). So my question is: Do you know any other compilers (and if so have any references, pointers, information about them)?
My list so far:
AutoESL
Bach-C (Sharp)
C2H (Altera)
C2R (Cebatech)
C2Verilog (CompiLogic / C Level Design / Synposys)
Carte / MAP (SRC Computers)
Cascade (CriticalBlue)
CASH (Carnegie Mellon University, Pittsburgh)
Catapult-C (Mentor Graphics)
CHC (Altium)
CHiMPS (University of Washington (Seattle) / Xilinx / soon commercial?)
C-to-Verilog (Haifa)
Comrade (TU Braunschweig E.I.S. + TU Darmstadt E.S.A.)
CVC (Hitachi)
Cyber (NEC)
Daedalus (Uni Amsterdam, Uni Leiden)
DIME-C (Nallatech)
eXCite (YXI)
FP-Compiler (Altera)
FpgaC (OpenSource)
GarpCC (Callahan, University of California at Berkeley)
GAUT (UBS-Universität Frankreich)
Handel-C (Celoxica)
Hthreads (University of Kansas)
Impulse-C (Impulse Accelerated Technologies)
Mitrion-C (Mitrionics)
DWARV (TU Delft)
NIMBLE (Synopsys, E.I.S. Braunschweig)
NISC (University of California, Irvine)
PICO-Express (Synfora => Synopsys)
PRISC (Harvard University, Cambridge)
ROCCC (University of California, Riverside)
SPARK (University of California, Irvine)
SpecC (Gajski et al.)
Trident (OpenSource, Los Alamos National Laboratory)
UGH
VEAL
vfTools (Vector Fabric)
xPilot (University of California, Los Angeles)
(I know not all on the list have C as soure, some use C-similar dialect, and almost all support only a subset, I am also interrested in such).
EDIT: I know how to use google, so I already checked the ususal suspects and have included the results. So it is very likely that someone can only answer here if he does really know some paper or exotic tool (or maybe not so exotic but that implements the functionality somehow hidden, and the compiler is not advertised).
System-C?
Rotem CToVerilog, I don't know anything about it, just googled it up.
LegUp: http://legup.eecg.utoronto.ca/
There is also HercuLeS (provisional name), which is MY HLS tool.
Get the (old) tech. demo from here
http://www.nkavvadias.co.cc/misc/hls-demo-linux-0.0.1.tar.gz
Things have progressed since then.
Let me know if you want a tech. presentation detailing a real-life examples, e.g. a multi-function CORDIC.
Cheers,
Nikolaos Kavvadias
OpenCL support at Altera and Xilinx.
OpenCV support by Xilinx. OpenCL + OpenCV support by Altera. See this post. I talk about the OpenCL+OpenCV both based on C languages.
Altera has OpenCL SDK which is used with Quartus. Xilinx has Vivado HLS.
Cynthesizer, which is SystemC based. CellMath will go the other way, take Verilog and create a C model.