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'
},
Related
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 use AngularJS to create a page where a user can correct a text (for example grammar, typo ... ).
I cannot use a Textarea because I want to keep trace about changes and let user rollback a correction on each word.
The following code work but it take a few seconds to render with page freeze, specialy on IE like 30 seconds), the text to correct can be very long like in the example.
I use a ng-repeat to display the text (which is an array of word). For each word I text in html if it is punctuation or a <br> or an editable word.
Is there a way to optimize this or to create in a JS way (like a compile html or anything faster)?
PLUNKER
HTML
<div ng-controller="Ctrl1">
Correct the text
<span ng-repeat="word in words track by $index">
<br ng-if="word.br"/>
<span ng-show="(!word.br)&& !word.edited">
<span ng-if="word.editable" class="correct-span" ng-click="word.edited = true">{{word.u}}</span>
<span ng-if="!word.editable">{{word.u}}</span>
</span>
<span class="my-danger" ng-show="(!word.br)&& word.edited">
<input type="text" ng-model="word.u">
<button ng-click="word.edited = false;word.u = word.o">X</button>
</span>
</span>
</div>
My controller :
var myApp = angular.module('myApp', []);
myApp.controller('Ctrl1', ['$scope', function($scope) {
function tools_isString(myVar){
return (typeof myVar == 'string' || myVar instanceof String);
}
/***
* test if object if defined
* #param object
* #returns {boolean}
*/
function tools_defined(object){
return (( typeof object !== undefined) && ( typeof object !== 'undefined') && ( object !== null ) && (object !== "")) ;
}
/**
* test if a word is in array
* #param mot : string
* #param tableau : array list
* #returns {boolean}
*/
function tools_inArray(word, array) {
if(tools_defined(array)&&tools_defined(word)) {
var length = array.length;
if (tools_isString(word)) {
word = word.toLowerCase();
}
for (var i = 0; i < length; i++) {
if (tools_isString(array[i])) {
array[i] = (array[i]).toLowerCase();
}
if (array[i] == word) return true;
}
}
return false;
}
function escapeRegExp(string) {
return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
}
function tools_replaceAll(str, find, replace) {
if(str == null ){
return null
}
return str.replace(new RegExp(escapeRegExp(find), 'g'), replace);
}
var prepareTextToCorrect = function(inputstring){
//encode new lines
inputstring = tools_replaceAll(inputstring,"<br/>","*br*");
inputstring = tools_replaceAll(inputstring,"<br>","*br*");
// unescape
inputstring = inputstring.replace(/&(lt|gt);/g, function (strMatch, p1){
return (p1 == "lt")? "<" : ">";
});
// remove all the hmtl tags
var rex = /(<([^>]+)>)|(<([^>]+)>)/ig;
inputstring = inputstring.replace(rex , "");
// re encode new lines
inputstring = tools_replaceAll(inputstring,"*br*"," <br/> ");
// separating punctuation from words
var ponctuations = [",","?",",",";",".",":","!","-","_","(",")","«","»","—"];
for(var p in ponctuations){
inputstring = tools_replaceAll(inputstring,ponctuations[p]," "+ponctuations[p]);
}
inputstring = tools_replaceAll(inputstring," "," ");
inputstring = tools_replaceAll(inputstring," "," ");
var elements = inputstring.split(" ");
var res = [];
/**
* "o" : original word
* "u" : word edited by user
* "edited" : if user edited this word
* "editable" : if the word can be edited ( ponctuation and <br> cannot )
*/
for(var i in elements){
if(elements[i].length>0) {
if(elements[i] == "<br/>") {
res.push({
"o": null, "u": null, "edited": false, "br":true
});
} else if (tools_inArray(elements[i], ponctuations)) {
res.push({
"o": elements[i], "u": elements[i], "edited": false,"editable": false , "br":false
});
}else{
res.push({
"o": elements[i], "u": elements[i], "edited": false,"editable": true , "br":false
});
}
}
}
return res ;
};
var text = "Stack Overflow is a question and answer site for professional and enthusiast programmers. It's built and run by you as part of the Stack Exchange network of Q&A sites. With your help, we're working together to build a library of detailed answers to every question about programming.<br/><br/>We're a little bit different from other sites. Here's how:<br/>Ask questions, get answers, no distractions<br/><br/>This site is all about getting answers. It's not a discussion forum. There's no chit-chat.<br/><br/>Just questions...<br/>...and answers.<br/>Good answers are voted up and rise to the top.<br/><br/>The best answers show up first so that they are always easy to find.<br/>accept<br/><br/>The person who asked can mark one answer as accepted.<br/><br/>Accepting doesn't mean it's the best answer, it just means that it worked for the person who asked.<br/>Do Swift-based applications work on OS X 10.9/iOS 7 and lower?<br/>up vote 14 down vote favorite<br/><br/>Will Swift-based applications work on OS X 10.9 (Mavericks)/iOS 7 and lower?<br/><br/>For example, I have a machine running OS X 10.8 (Mountain Lion), and I am wondering if an application I write in Swift will run on it.<br/>ios osx swift<br/>asked Jun 2 '14 at 19:25<br/>MeIr<br/>3,27752557<br/>2 Answers<br/>up vote 4 down vote accept<br/><br/>Swift code can be deployed to OS X 10.9 and iOS 7.0. It will usually crash at launch on older OS versions.<br/>answered Jun 3 '14 at 8:25<br/>Greg Parker<br/>6,21011118<br/>up vote 3 down vote<br/><br/>Apple has announced that Swift apps will be backward compatible with iOS 7 and OS X Mavericks. The WWDC app is written in Swift.<br/>answered Jun 3 '14 at 0:03<br/>Ben Gottlieb<br/>73.3k19161166<br/>Get answers to practical, detailed questions<br/><br/>Focus on questions about an actual problem you have faced. Include details about what you have tried and exactly what you are trying to do.<br/><br/>Ask about...<br/><br/>Specific programming problems<br/>Software algorithms<br/>Coding techniques<br/>Software development tools<br/><br/>Not all questions work well in our format. Avoid questions that are primarily opinion-based, or that are likely to generate discussion rather than answers.<br/><br/>Questions that need improvement may be closed until someone fixes them.<br/><br/>Don't ask about...<br/><br/>Questions you haven't tried to find an answer for (show your work!)<br/>Product or service recommendations or comparisons<br/>Requests for lists of things, polls, opinions, discussions, etc.<br/>Anything not directly related to writing computer programs<br/><br/>Tags make it easy to find interesting questions<br/><br/>Stack Overflow is a question and answer site for professional and enthusiast programmers. It's built and run by you as part of the Stack Exchange network of Q&A sites. With your help, we're working together to build a library of detailed answers to every question about programming.<br/><br/>We're a little bit different from other sites. Here's how:<br/>Ask questions, get answers, no distractions<br/><br/>This site is all about getting answers. It's not a discussion forum. There's no chit-chat.<br/><br/>Just questions...<br/>...and answers.<br/>Good answers are voted up and rise to the top.<br/><br/>The best answers show up first so that they are always easy to find.<br/>accept<br/><br/>The person who asked can mark one answer as accepted.<br/><br/>Accepting doesn't mean it's the best answer, it just means that it worked for the person who asked.<br/>Do Swift-based applications work on OS X 10.9/iOS 7 and lower?<br/>up vote 14 down vote favorite<br/><br/>Will Swift-based applications work on OS X 10.9 (Mavericks)/iOS 7 and lower?<br/><br/>For example, I have a machine running OS X 10.8 (Mountain Lion), and I am wondering if an application I write in Swift will run on it.<br/>ios osx swift<br/>asked Jun 2 '14 at 19:25<br/>MeIr<br/>3,27752557<br/>2 Answers<br/>up vote 4 down vote accept<br/><br/>Swift code can be deployed to OS X 10.9 and iOS 7.0. It will usually crash at launch on older OS versions.<br/>answered Jun 3 '14 at 8:25<br/>Greg Parker<br/>6,21011118<br/>up vote 3 down vote<br/><br/>Apple has announced that Swift apps will be backward compatible with iOS 7 and OS X Mavericks. The WWDC app is written in Swift.<br/>answered Jun 3 '14 at 0:03<br/>Ben Gottlieb<br/>73.3k19161166<br/>Get answers to practical, detailed questions<br/><br/>Focus on questions about an actual problem you have faced. Include details about what you have tried and exactly what you are trying to do.<br/><br/>Ask about...<br/><br/>Specific programming problems<br/>Software algorithms<br/>Coding techniques<br/>Software development tools<br/><br/>Not all questions work well in our format. Avoid questions that are primarily opinion-based, or that are likely to generate discussion rather than answers.<br/><br/>Questions that need improvement may be closed until someone fixes them.<br/><br/>Don't ask about...<br/><br/>Questions you haven't tried to find an answer for (show your work!)<br/>Product or service recommendations or comparisons<br/>Requests for lists of things, polls, opinions, discussions, etc.<br/>Anything not directly related to writing computer programs<br/><br/>Tags make it easy to find interesting questions<br/><br/>Stack Overflow is a question and answer site for professional and enthusiast programmers. It's built and run by you as part of the Stack Exchange network of Q&A sites. With your help, we're working together to build a library of detailed answers to every question about programming.<br/><br/>We're a little bit different from other sites. Here's how:<br/>Ask questions, get answers, no distractions<br/><br/>This site is all about getting answers. It's not a discussion forum. There's no chit-chat.<br/><br/>Just questions...<br/>...and answers.<br/>Good answers are voted up and rise to the top.<br/><br/>The best answers show up first so that they are always easy to find.<br/>accept<br/><br/>The person who asked can mark one answer as accepted.<br/><br/>Accepting doesn't mean it's the best answer, it just means that it worked for the person who asked.<br/>Do Swift-based applications work on OS X 10.9/iOS 7 and lower?<br/>up vote 14 down vote favorite<br/><br/>Will Swift-based applications work on OS X 10.9 (Mavericks)/iOS 7 and lower?<br/><br/>For example, I have a machine running OS X 10.8 (Mountain Lion), and I am wondering if an application I write in Swift will run on it.<br/>ios osx swift<br/>asked Jun 2 '14 at 19:25<br/>MeIr<br/>3,27752557<br/>2 Answers<br/>up vote 4 down vote accept<br/><br/>Swift code can be deployed to OS X 10.9 and iOS 7.0. It will usually crash at launch on older OS versions.<br/>answered Jun 3 '14 at 8:25<br/>Greg Parker<br/>6,21011118<br/>up vote 3 down vote<br/><br/>Apple has announced that Swift apps will be backward compatible with iOS 7 and OS X Mavericks. The WWDC app is written in Swift.<br/>answered Jun 3 '14 at 0:03<br/>Ben Gottlieb<br/>73.3k19161166<br/>Get answers to practical, detailed questions<br/><br/>Focus on questions about an actual problem you have faced. Include details about what you have tried and exactly what you are trying to do.<br/><br/>Ask about...<br/><br/>Specific programming problems<br/>Software algorithms<br/>Coding techniques<br/>Software development tools<br/><br/>Not all questions work well in our format. Avoid questions that are primarily opinion-based, or that are likely to generate discussion rather than answers.<br/><br/>Questions that need improvement may be closed until someone fixes them.<br/><br/>Don't ask about...<br/><br/>Questions you haven't tried to find an answer for (show your work!)<br/>Product or service recommendations or comparisons<br/>Requests for lists of things, polls, opinions, discussions, etc.<br/>Anything not directly related to writing computer programs<br/><br/>Tags make it easy to find interesting questions<br/><br/>Stack Overflow is a question and answer site for professional and enthusiast programmers. It's built and run by you as part of the Stack Exchange network of Q&A sites. With your help, we're working together to build a library of detailed answers to every question about programming.<br/><br/>We're a little bit different from other sites. Here's how:<br/>Ask questions, get answers, no distractions<br/><br/>This site is all about getting answers. It's not a discussion forum. There's no chit-chat.<br/><br/>Just questions...<br/>...and answers.<br/>Good answers are voted up and rise to the top.<br/><br/>The best answers show up first so that they are always easy to find.<br/>accept<br/><br/>The person who asked can mark one answer as accepted.<br/><br/>Accepting doesn't mean it's the best answer, it just means that it worked for the person who asked.<br/>Do Swift-based applications work on OS X 10.9/iOS 7 and lower?<br/>up vote 14 down vote favorite<br/><br/>Will Swift-based applications work on OS X 10.9 (Mavericks)/iOS 7 and lower?<br/><br/>For example, I have a machine running OS X 10.8 (Mountain Lion), and I am wondering if an application I write in Swift will run on it.<br/>ios osx swift<br/>asked Jun 2 '14 at 19:25<br/>MeIr<br/>3,27752557<br/>2 Answers<br/>up vote 4 down vote accept<br/><br/>Swift code can be deployed to OS X 10.9 and iOS 7.0. It will usually crash at launch on older OS versions.<br/>answered Jun 3 '14 at 8:25<br/>Greg Parker<br/>6,21011118<br/>up vote 3 down vote<br/><br/>Apple has announced that Swift apps will be backward compatible with iOS 7 and OS X Mavericks. The WWDC app is written in Swift.<br/>answered Jun 3 '14 at 0:03<br/>Ben Gottlieb<br/>73.3k19161166<br/>Get answers to practical, detailed questions<br/><br/>Focus on questions about an actual problem you have faced. Include details about what you have tried and exactly what you are trying to do.<br/><br/>Ask about...<br/><br/>Specific programming problems<br/>Software algorithms<br/>Coding techniques<br/>Software development tools<br/><br/>Not all questions work well in our format. Avoid questions that are primarily opinion-based, or that are likely to generate discussion rather than answers.<br/><br/>Questions that need improvement may be closed until someone fixes them.<br/><br/>Don't ask about...<br/><br/>Questions you haven't tried to find an answer for (show your work!)<br/>Product or service recommendations or comparisons<br/>Requests for lists of things, polls, opinions, discussions, etc.<br/>Anything not directly related to writing computer programs<br/><br/>Tags make it easy to find interesting questions<br/><br/>" ;
$scope.words = prepareTextToCorrect(text) ;
}]);
Try using ng-if instead of ng-show in your <span> tags. In such a way the browser does not need to render all the DOM nodes that you use when the word is edited. With ng-show the nodes are rendered and then hidden from the DOM using CSS. This means that the browser has to render nodes that you potentially do not use, it is highly probable that you only need to change few words and not the entire document! Try to see if this can improve the rendering time.
Whatever the front-end framework, tracking each word of a text is going to put the browser on its knees, no matter if you have V8, Turbo, 4x4 or whatever.
Just picture the number of nodes. Take a deep deep look at your DOM element, just one of your ng-if spans in your case, and imagine each one of its endless list of attributes being tracked. But you probably already know.
With angular 1.x, you can check if a textarea is $dirty on mouseup, and/or blur, and/on mousemove with a simple directive.
Just wire a service that stores any change made to the whole textarea whenever one of the above events triggers.
In short, it's going to be less expensive to store the whole textarea on every event (after all, its content is just a string, nothing too hard for a browser to handle, even if the string is big — but I'm sure you care about your users and your textarea won't end up to be massive).
To store every change made to the textarea, you can use localStorage and/or a remote DB, using possibly angular locker for localStorage abstractions, and Firebase (AngularFire), which is going to handle automagically any changes made to the textarea given you previously wire the textarea content to a Firebase object.
But your back-end could be of course any data API. I would to suggest to store a limited amount of "Ctrl/Cmd+Z" into localStorage, and for the external DB, well, it's up to you to store infinite versions. That's where Firebase would come in handy, because by forcing you to make adhere to a JSON, you can store by month, week, day, therefore accelerating your retrieval queries for when the end user wants to go back in history.
does anyone use arima.rob() function described by Eric Zivot and Jiahui Wang in { Modelling Financial Time Series with S-PLUS } ?
I have a question about it:
I used a dataset of network traffic flows that has anomaly, and I tried to predict the last part of dataset by robust ARIMA method (Arima.rob() function) .I compare this model with arima.mle of S-PLUS. But Unexpectedly, arima.rob’s prediction did not better than that.
I’m not sure my codes are correct and may be the reason of fault is my codes.
Please, help me if I used Arima.rob inappropriately?
tmp.rr<-arima.rob((tmh75)~1,p=2,d=1,q=2,freq=24,maxiter=4,max.fcal=80000)
tmp.for<-predict(tmp.rr,n.predict=10,newdata=df1,se=T)
plot(tmp.for,tmh75)
summary(tmp.for)
my code for classic arima:
`model <- list(list(order=c(2,1,2)),list(order=c(3,1,2),period=24))
fith <- arima.mle(tmh75-mean(tmh75),model=model)
foreh <- arima.forecast(tmh75,n=25,model=fith$model)
tsplot(tmh75,foreh$mean,foreh$mean+foreh$std.err,foreh$mean-foreh$std.err)
`
I found a work around to a problem I had, and I want to know if it is valid or not. It is a similar problem to: Grails Gorm : Object references an unsaved transient instance
Lets assume I have two domain Objects (names changed to protect the guilty).
public class Shelf {
String name
Set<Book> books = [] as Set
static hasMany = [books: Book]
}
and
public class Book {
String title
Shelf shelf
}
So this means that 1 Shelf contains 0 to many Books, and one Book can be on only one Shelf.
This Shelf is very large. And at some point, it contains 80,000 Books. All stored nicely in the DB. Of course, adding new Books is getting slower and slower.
This is done by:
Book book1 = new Book("Awesome Title")
existingShelf.addToBooks(book1)
existingShelf.save(flush: true) // super slow
This is slow. Mainly (I assume) because GORM has to confirm the other 80,000 records.
So I did this to try to work around the slow point.
Book book2 = new Book("Awesome Title 2")
book2.save(flush: true)
This gives me an "Object references an unsaved transient instance", which I guess makes sense - the "shelf" value is empty.
So I did something a little weird:
Book book3 = new Book("Awesome Title 3")
book3.shelf = new Shelf()
book3.shelf.id = <known/valid id here>
book2.save(flush: true)
This works. It saves. There are no referential errors. Further code that depends on this... works.
I just made a call that last minutes and reduced it down to seconds.
But that seems too easy. I'm sure I worked around Grails magic some how. And probably broke something in the process.
Advice? Explanations?
Yes, using addTo* methods can be slow. If you look at the generated SQL you'll understand why. Doing the following:
new Book(title: "GORM Performance", shelf: grailsShelf).save()
will be faster and there is technically nothing wrong with it. Just be aware of that your instance of grailsShelf.books will not contain the new book until you've refreshed the collection from the database. This is part of what the addTo* method does for you.
Side note:
Set<Book> books = [] as Set
is unnecessary.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Do you know any example for this topic?.
I have searched google but had no luck with any Decision Making using Artificial Intelligence example ( at least any truly developed)
i have an example for decision making in AI. it is about choosing a dress to purchase. It asks for inputs as follows:
1) Whether you are Male or Female
2)Price range must be less than 1000 or greater than 1000
3)Age <20 or >20
Based on these inputs , my code will analyse which type of dress suits you and in which shop you can purchase it. I have just given few knowledge in my code. Only 3 shop's names i have kept in my knowledge base.
It gives output as a percentage .
Eg) Shop A: 20.5%
Shop B: 40.5&
Shop C: 39.0%
This means that you have high probability of finding your favourite dresses in Shop B.
$ import java.util.*;
import java.lang.*;
import javax.swing.*;
import java.util.Collection.*;
import java.util.Set.*;
public class dress1
{
static int i,j;
static float[] count=new float[3];static int[] count1=new int[3];
static String[] shop=new String[] {"Jean and Tops","Jean and T-shirt","Jean and Shirt/T-shirt","Sherwani","Pyjamas","Formal shirt and Pant","Shorts and shirt","Coat Suit","Sari","Skirt and Tops","Ghagra Choli","Salwar kameez","Churidaar","Pattu Pavadai","Frock"};
static int[] divac= {10,9,8,1,1,2,1,1,7,1,1,1,5,1,1};
static int[] kalac= {1,1,1,2,1,1,1,1,10,1,8,2,2,9,1};
static int[] megac= {7,5,6,3,2,8,2,6,2,4,2,1,2,2,2};
static String[] selected=new String[15];
static boolean value;
public static void main(String arg[])
{
count[0]=0;count[1]=0;count[2]=0;
Set uni = new HashSet();
uni.add("Jean and Tops");
uni.add("Jean and T-shirt");
uni.add("Sari");
uni.add("Skirt and Tops");
uni.add("Ghagra Choli");
uni.add("Salwar kameez");
uni.add("Churidaar");
uni.add("Pattu Pavadai");
uni.add("Sherwani");
uni.add("Frock");
uni.add("Formal shirt and Pant");
uni.add("Jean and Shirt/T-shirt");
uni.add("Shorts and shirt");
uni.add("Coat Suit");
uni.add("Pyjamas");
Set male = new HashSet();
male.add("Sherwani");
male.add("Pyjamas");
male.add("Formal shirt and Pant");
male.add("Jean and Shirt/T-shirt");
male.add("Shorts and shirt");
male.add("Coat Suit");
Set fem = new HashSet();
fem.add("Jean and Tops");
fem.add("Jean and T-shirt");
fem.add("Sari");
fem.add("Skirt and Tops");
fem.add("Ghagra Choli");
fem.add("Salwar kameez");
fem.add("Churidaar");
fem.add("Pattu Pavadai");
fem.add("Frock");
Set l20=new HashSet();
l20.add("Jean and Tops");
l20.add("Jean and T-shirt");
l20.add("Skirt and Tops");
l20.add("Churidaar");
l20.add("Pattu Pavadai");
l20.add("Frock");
Set g20=new HashSet();
g20.add("Jean and T-shirt");
g20.add("Sari");
g20.add("Salwar kameez");
g20.add("Churidaar");
Set ml20=new HashSet();
ml20.add("Pyjamas");
ml20.add("Shorts and shirt");
Set mg20=new HashSet();
mg20.add("Sherwani");
mg20.add("Formal shirt and Pant");
mg20.add("Coat Suit");
mg20.add("Jean and Shirt/T-shirt");
Set mpl1000= new HashSet();
mpl1000.add("Pyjamas");
mpl1000.add("Shorts and shirt");
mpl1000.add("Formal shirt and Pant");
Set mpg1000=new HashSet();
mpg1000.add("Sherwani");
mpg1000.add("Coat Suit");
mpg1000.add("Jean and Shirt/T-shirt");
Set pl1000=new HashSet();
pl1000.add("Frock");
pl1000.add("Skirt and Tops");
pl1000.add("Churidaar");
pl1000.add("Salwar kameez");
Set pg1000=new HashSet();
pg1000.add("Jean and Tops");
pg1000.add("Jean and T-shirt");
pg1000.add("Sari");
pg1000.add("Ghagra Choli");
pg1000.add("Pattu Pavadai");
Scanner input=new Scanner(System.in);
System.out.println("Enter M for Male and F for Female");
String st=input.nextLine();
Set int1 = new HashSet (uni);
if(st.equals("M"))
{
System.out.println("Male");
int1.retainAll(male);
Scanner input1=new Scanner(System.in);
System.out.println("Enter 1 if age <20 or enter 2 if age > 20");
String st1=input1.nextLine();
Set int2= new HashSet (int1);
if(st1.equals("1"))
{
System.out.println("Age Less than 20 Male");
int2.retainAll(ml20);
}
else if(st1.equals("2"))
{
System.out.println("Age Greater than 20 Male");
int2.retainAll(mg20);
}
Scanner input2=new Scanner(System.in);
System.out.println("Enter 1.Price Range < 1000 or 2. Price Range >1000");
String st2=input2.nextLine();
Set int3= new HashSet (int2);
if(st2.equals("1"))
{
System.out.println("Price Less than 1000 ,Male");
int3.retainAll(mpl1000);
}
else if(st2.equals("2"))
{
System.out.println("Price Greater than 1000 ,Male");
int3.retainAll(mpg1000);
}
i=0;
for(Object object : int3)
{
String element = (String) object;
selected[i++]=element;
System.out.println(element);
}
calc();
} /*end of male*/
else if(st.equals("F"))
{
System.out.println("Female");
int1.retainAll(fem);
Scanner input1=new Scanner(System.in);
System.out.println("Enter 1 if age <20 or enter 2 if age > 20");
String st1=input1.nextLine();
Set int2= new HashSet (int1);
if(st1.equals("1"))
{
System.out.println("Age Less than 20 Female");
int2.retainAll(l20);
}
else if(st1.equals("2"))
{
System.out.println("Age Greater than 20 Female");
int2.retainAll(g20);
}
Scanner input2=new Scanner(System.in);
System.out.println("Enter 1.Price Range < 1000 or 2. Price Range >1000");
String st2=input2.nextLine();
Set int3= new HashSet (int2);
if(st2.equals("1"))
{
System.out.println("Price Less than 1000 ,Female");
int3.retainAll(pl1000);
}
else if(st2.equals("2"))
{
System.out.println("Price Greater than 1000 ,Female");
int3.retainAll(pg1000);
}
i=0;
for(Object object : int3)
{
String element = (String) object;
selected[i++]=element;
System.out.println(element);
}
calc();
}/*end of female*/
}/*end of main*/
public static void calc()
{
float finalcount=0;
int k=0;
while(k<i)
{
for(j=0;j<15;j++)
{
value=selected[k].equals(shop[j]);
if(value)
{
break;
}
}/*end of j*/
count[0]=count[0]+divac[j];
count[1]=count[1]+kalac[j];
count[2]=count[2]+megac[j];
k++;
}/*end of while*/
for(int c=0;c<3;c++)
{
finalcount=finalcount+count[c];
}
for(int c=0;c<3;c++)
{
count[c]=((count[c]*100)/finalcount);
}
System.out.println("Availability of dresses available in various shops are:");
System.out.println("Diva is "+count[0]+"%");
System.out.println("Kalanikethan is "+count[1]+"%");
System.out.println("Megamart is "+count[2]+"%");
}
}/*end of class*/
http://msl.cs.uiuc.edu/~lavalle/cs397/
Read this. There are different ways to go about AI decision making. The examples are on the bottom.
Decision-making (DM) is a topic widely studied by different fields of science. (Cognitive sciences, Neurosciences, Computer sciences, Behavioral Economics, Operations research, etc. *1)
However, DM problems are varied and the computational approach to address that problem will vary accordingly. For instance:
If you have to make a frequent decision that affects the previous one you are dealing with a sequential DM problem. In those cases, reinforcement learning *2 or deep reinforcement learning *3 can be used to tackle this problem. Examples of these problems can be seen in video-games where the game AI needs to take different actions (policies) over time to maximise its score. (reward)
If you the problem is not sequential but you deal with multiple criteria to find the most attractive alternative then you are dealing with a multi-criteria decision-making problem, topic widely researched in operations research. There are some typically-used algorithms that are utilised to assist human-decision making like AHP*4, TOPSIS*5, ELECTRE*6, PROMETREE*7. An example of MCDC is selecting a house to buy, where you have to consider location, price among other desirable or undesirable characteristics.
Depending on the level of uncertainty, subjective data and incomplete information of the problem you might require to use fuzzy, intuitionistic or neutrosophic variations of the mentioned algorithms. *8
You might need to optimise DM through different competing goals. In that case, you are dealing with a multi-objective decision-making optimisation problem (MODM). See Decision trees*9, genetic algorithms*10 .
Furthermore, a DM problem can have different 'agents' making decision that can affect ours. So that is known as 'multi-agent' decision-making. In computer science, multi-agent system simulations are commonly used to research these problems. *11
You can also have the case where the agents have to make a collaborative decision that affects all of them. So that is known as 'group' decision-making.
In the industry, computational DM can be seen with the widely used recommender systems such as the ones in Netflix or Amazon.*13 In the B2B sector, AI in DM can be seen in decision-support systems and prescriptive analytics services *14.
I hope you find that information useful. There is indeed, much more about this complex topic, I just tried to summarise.
Some resources you might want to check:
Deep RTS: A playground for reinforcement learning agents in real-time strategy game environments. (Repository: https://github.com/cair/deep-rts) (Pre-print Paper: https://arxiv.org/abs/1808.05032)
OpenAI Gym: A general-purpose playground to test reinforcement learning AI algorithms. (Github: https://github.com/openai/gym, page: https://gym.openai.com/)
DecisionRadar: An online application to apply TOPSIS decision-making algorithm. (Site: https://decision-radar.com/)
AgentSimJS: A 3D multi-agent simulation system built in Javascript. (Repository: https://github.com/maxdeben83/agentsimjs)
REFERENCES:
*1 Atkinson, J. W. (1964). An introduction to motivation.
*1 Berridge, K. C. (2004). Motivation concepts in behavioral neuroscience. Physiology & behavior, 81(2), 179-209.
*1 Hwang, C. L., & Yoon, K. (1981). Methods for multiple attribute decision making. In Multiple attribute decision making (pp. 58-191).Springer, Berlin, Heidelberg.
*1 Tversky, A., & Kahneman, D.(1981). The framing of decisions and the psychology of choice science, 211(4481), 453-458.
*2 Littman, M. L. (1994). Markov games as a framework for multi-agent reinforcement learning. In Machine Learning Proceedings 1994 (pp. 157-163).
*3 Van Hasselt, H., Guez, A., & Silver, D. (2016, February). Deep Reinforcement Learning with Double Q-Learning. In AAAI (Vol. 2, p. 5).
*4 Aczél, J., & Saaty, T. L. (1983). Procedures for synthesizing ratio judgements. Journal of Mathematical Psychology, 27(1),
93–102. doi:10.1016/0022-2496(83)90028-7
*4 Saaty, R. W. (1987). The analytic hierarchy process—what it is and how it is used. Mathematical Modelling, 9(3-5), 167.
doi:10.1016/0270-0255(87)90473-8
*4 Saaty, T. L. (1986). Axiomatic Foundation of the Analytic Hierarchy Process. Management Science, 32(7), 841.
doi:10.1287/mnsc.32.7.841
*4 Hwang, C. L., & Yoon, K. (1981). Methods for multiple attribute decision making. In Multiple attribute decision
making (pp. 58-191). Springer, Berlin, Heidelberg.
*6 Zhou, Y. (1915). Multi-Criteria Decision Making in Software Development: A Systematic Literature Review.
*7 Zhou, Y. (1915). Multi-Criteria Decision Making in Software Development: A Systematic Literature Review.
*8 Pramanik, S., Biswas, P., & Giri, B. C. (2015). Hybrid vector similarity measures and their
applications to multi-attribute decision making under neutrosophic
environment. Neural Computing and Applications, 28(5), 1163
doi:10.1007/s00521-015-2125-3
*8 Mardani, A., Nilashi, M., Zavadskas, E. K., Awang, S. R., Zare, H., & Jamal, N. M. (2018). Decision Making Methods Based on Fuzzy
Aggregation Operators: Three Decades Review from 1986 to 2017.
International Journal of Information Technology & Decision Making,
17(02), 391–466. doi:10.1142/s021962201830001x
*9 Zhao, H. (2007). A multi-objective genetic programming approach to developing Pareto optimal decision trees. Decision Support
Systems, 43(3), 809-826.
*9 Laumanns, M., & Ocenasek, J. (2002, September). Bayesian optimization algorithms for multi-objective optimization. In
International Conference on Parallel Problem Solving from Nature (pp.
298-307). Springer, Berlin, Heidelberg.
*9 Jin, Y. (Ed.). (2006). Multi-objective machine learning (Vol. 16). Springer Science & Business Media.
10 Tamaki, H., Kita, H., & Kobayashi, S. (1996, May).
Multi-objective optimization by genetic algorithms: A review.
In Evolutionary Computation, 1996., Proceedings of IEEE
International Conference on (pp. 517-522). IEEE.
*11 Rodriguez, S., Gaud, N., & Galland, S. (2014, August). SARL: a general-purpose agent-oriented programming language. In
Web Intelligence (WI) and Intelligent Agent Technologies (IAT),
2014 IEEE/WIC/ACM International Joint Conferences on (Vol. 3,
pp. 103-110). IEEE.
*12 Rao, A. S. (1996, January). AgentSpeak (L): BDI agents speak out in a logical computable language. In European Workshop on Modelling Autonomous Agents in a Multi-Agent World (pp. 42-55). Springer, Berlin, Heidelberg.
*13 Ricci, F., Rokach, L., & Shapira, B. (2015). Recommender systems: introduction and challenges. In Recommender systems
handbook (pp. 1-34). Springer, Boston, MA.
*14 https://www.ibm.com/analytics/prescriptive-analytics
There are simply too many examples to count! The whole (large) field of expert systems development, for example, consists of building programs whose explicit purpose is to emulate human decision making. Google "expert systems" to find thousands of examples.
I'll put in a plug for Jess, an expert system shell written in Java which I developed. It's used by thousands of companies world wide to automate decision-making processes.
I did a bit of browsing on the web and I came across this example project.
You might also check out the AI-Depot website here.
Probably the reason there are not so many working examples is because AI decision algorithms, such as neural networks, genetic algorithms, and decision trees get very complex, very quickly. Most developers of such algorithms, at least the algorithms that are stable and actually work, are very protective of their IP. And, for good reason.
In any case, hope this helped.
Let It Be Known