Posts

Showing posts from 2012

java - using loopback for testing environment -

i want run 2 instance of same server on same physical machine. these 2 servers listen same port, 12345. trying run 1 server on 127.0.0.1, , other 1 on 127.0.0.2. these 2 servers send , receive messages using same port running on separate loopback addresses. not know if on correct path set test environment? somehow, not able setting testing environment. using java develop server. you can bind 2 servers same port if specify 2 different interfaces: serversocket s1 = new serversocket(port, 500, inetaddress.getbyname("127.0.0.1")); serversocket s2 = new serversocket(port, 500, inetaddress.getbyname("127.0.0.2"));

database - Creating index on sorted data -

i have text file sorted data, splitted newline. example: ... abc123 abc124 abd123 abd124 abd125 ... now want create index dataset, should (at least) support: getstringbyindex(n) : return nth item of sorted list; getindexbystring(s) : find s in items, return index (or -1 if not found); i've read indexing algorithms hashing , b-trees. b-tree field of children size should well. since dateset sorted, wonder if there more effecient solution building b-tree inserting items it? since data sorted, can locate content , efficiently keeping small, sparse subset of data in memory. example, let's decide store every nth element in memory. efficient initialization of api, you'd want compile sparse list in separate file on disk, don't have stream through 100gb of data it. for each of these terms, need save disk offset relative head of file term starts. then, you've got load sparse list / offset pairs memory, , implementations of 2 requests become

css - Add line break in <pre> tag -

i using css pre tag. not add line break , code mixed. want add line break same add in writing pane hitting enter. pre { font-size:16px; overflow: auto; padding:10px; background-color: #f8f8f8; border: 1px solid #ddd; white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* mozilla, since 1999 */ white-space: -pre-wrap; /* opera 4-6 */ white-space: -o-pre-wrap; /* opera 7 */ word-wrap: break-word; /* internet explorer 5.5+ */ }

javascript - Putting JQuery into PHP file -

i trying put jquery php file. need put twitter feed works when put html file cant work in homepage.php file. it this tutorial . i have created seperate javascript file , tried echo script having no luck. here php file: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> <script type="text/javascript" src="js/jquery.twitter.feed.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#twitter-feed').dctwitterfeed({ id: '#thepaulmac', tweetid: 'thepaulmac', retweets: false, replies: false, avatar: false, results: 20, images: 'small' }); }); </script> <?php get_header(); ?> <div id="twitter-feed"></div> does know have work?

php - Dynamic relation between GOOGLE Maps API v3 and MySQL -

i designing own first web page. it's real estate page users add open house information while others can pull info. code database , web (after 2 months...) , inserting , getting data sweet... google maps. trying have trulia or original housingmaps.com (it seems started mash up, right?). crimereports.com nice, too. goal: pull addresses database, long , lat geocode, insert table, display in google map. plus: people pan map, new info pops map. here code retrieving addresses, geo code, , add lat , lng database. <?php //require("phpsqlajax_dbinfo.php"); // opens connection mysql server $username = "abc"; //personal info changed abc $password = "abc"; $hostname = "abc"; $database = "abc"; $connection = mysqli_connect($hostname, $username, $password); if (mysqli_connect_errno()) { printf("connect failed: %s\n", mysqli_connect_error()); exit(); } //if (!$connection) { //die("not connected : " .

java - Netbeans JFrame initialization; build is fine, but no window is made -

i'm using java, , trying create gui netbeans. i've done before, , i'm puzzled because code, while netbeans doesn't give errors, not produce new jframe window when run in netbeans. however, code initializes jframe identical previous gui-possessing program ("program one"). when try running "program one", works fine. here problem code; package aircannoncalculator; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.jtextfield; public class calcgui extends jframe { public calcgui(){ settitle("air cannon modeler"); setsize(400,400); setlocationrelativeto(null); setdefaultcloseoperation(jframe.exit_on_close); } public static void main(string[] args){ calcgui gui = new calcgui(); gui.setvisible(true); } } according netbeans, build goes fine, said, no actual window produced. doing wr

javascript - Disabling JSHint indentation check only for a specific file -

i use jshint indent enforcing option enabled , set 4, , keep way files in codebase. in 1 specific file though, disable check. i tried adding jshint comment @ top didn't work: /* jshint indent: false */ this bad because syntax works other options. example, can disable camelcase enforcing option following: /* jshint camelcase: false */ how can this? some answers suggest indent automatically enables white option, tried following , didn't work either: /* jshint white: false */ this not possible. jshint validates value of indent option follows: if (typeof val !== "number" || !isfinite(val) || val <= 0 || math.floor(val) !== val) { error("e032", nt, g[1].trim()); return; } as you've noticed in comments on question, raise error if value not integer greater 0. doesn't put maximum limit on integer though. depending on how running jshint may possible override default configuration files don't care indentation.

c# - Passing large amounts of data in an WCF service -

i've seen question pop few times no real definitive answer (as there none)... have wcf service needs return approximately 14,000 rows of data sql sorted in list<> based array. my service config looks like: <system.servicemodel> <bindings> <basichttpbinding> <binding name="basichttpbinding_iparts" closetimeout="00:01:00" opentimeout="00:01:00" receivetimeout="00:10:00" sendtimeout="00:01:00" allowcookies="false" bypassproxyonlocal="false" hostnamecomparisonmode="strongwildcard" maxbuffersize="2147483647" maxbufferpoolsize="2147483647" maxreceivedmessagesize="2147483647" messageencoding="text" textencoding="utf-8" transfermode="buffered" usedefaultwebproxy="true"> <readerquotas maxdepth="32" maxstringcontentlength="2147483647"

activerecord - Rails Associations has_one Latest Record -

i have following model: class section < activerecord::base belongs_to :page has_many :revisions, :class_name => 'sectionrevision', :foreign_key => 'section_id' has_many :references has_many :revisions, :class_name => 'sectionrevision', :foreign_key => 'section_id' delegate :position, to: :current_revision def current_revision self.revisions.order('created_at desc').first end end where current_revision created revision . possible turn current_revision association can perform query section.where("current_revision.parent_section_id = '1'") ? or should add current_revision column database instead of trying create virtually or through associations? i understand want sections last revision of each section has parent_section_id = 1; i have similar situation, first, sql (please think categories sections you, posts revisions , user_id parent_section_id -sor

php - $_GET does not work in Codeigniter 2.1.3 -

this question has answer here: codeigniter php framework - need query string 12 answers how can read querystring in codeigniter? 3 answers i want ref value uri looks http://localhost/project/?ref=6 know $_get['ref'] not work in codeigniter. tried enable setting $config['allow_get_array'] = true; didn't work. i read on somewhere using $this->input->get('ref') no luck. before using did loaded input library in config.php. note: want access value in model added in config.php $config['uri_protocol'] = "path_info"; $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-?'; and commented existing $config['uri_protocol'] = 'request_uri'; , $config['permitted_uri_chars'] = 'a-z

Updating multiple fields in a table form in one submit with PHP -

i attempting create form within table can update inventory numbers of chemicals have on hand, changes daily. want values in mysql populated text box, can edited , update current inventory values edited new inventory number submitted @ once 1 click of submit button. from research have found, looks array allow me this, have yet work. this far have gotten. can print table , insert values in text boxes, when go update them either nothing happens, or update them same value depending on have tweeked @ moment. <html> <head> <title>chemical room 2</title> </head> <body> <div align="center"> <form method='post' name='update' action='updatecr2.php' /> <?php // connects database mysql_connect("domain.com", "username", "password") or die(mysql_error()); mysql_select_db("chem_inventory") or die(mysql_error()); $data = mysql_query("select * chem

asp.net - Disable Durandal inline styling -

durandal appears automatically add following inline styling div elements wrapping data-views: style="margin-left: 0px; margin-right: 0px; opacity: 1; display: block;" this occurs in both durandal , john papa hot towel asp.net spa templates make use of durandal. this inline styling overriding external stylesheet, need disable behavior. i'm assuming being injected 1 of javascript files, can't life of me seem figure out where. anyone know how prevent inline styling being added? this being set "entrance" transition (durandal/transitions/entrance.js). looks final end point transition values, , they're not being removed when transition complete. you can avoid entirely not using transition. take couple of steps: in main.js, modify app.setroot() call remove 'entrance' parameter. prevent styling settings being added shell container in shell.html, remove transition setting compose binding. prevent styling settings being added

pointers - C programming segmentation fault linked list program -

i new c (and site) , having lot of issues segmentation faults. writing program creates linked list of numbers , inserts values in ascending order. void insert(struct element **head, struct element *new){ if((*head)->next == null && (*new).i > (*(*head)->next).i){ (*head)->next = new; return; } if((*head)->next == null && (*new).i < (*(*head)->next).i){ new->next = (*head)->next; *head = new; return; } struct element *prev = *head; struct element *current = (*head)->next; while(current->next != null){ if((*new).i < (*current).i){ prev = current; current = current->next; } else if((*new).i > (*current).i){ new->next = current; prev-&g

ruby on rails - inserting binding.pry changes which rspec tests pass -

tl;dr: trying test correct items added array. when ran test, said things being added array indiscriminately. however, when put binding.pry in first line of lessonpackage.available, tests pass... now, 2 other tests fail. now here's code. in original test, test correct number of items added array. tests :current scope. here's test: describe 'manage multiple lessons' before :all @six_package = create(:lesson_package) @thirteen_package = create(:lesson_package, name: 'thirteen', number_of_lessons: 13) @old_package = create(:lesson_package, name: 'canceled', current: false) @instructor = create(:instructor, base_lesson_price: 50, contract_rate: 40) end context 'available' 'return array of available package managers when given defaults' packages = lessonpackage.available(@instructor) packages.length.should 2 packages[0].class.should lessonpackagemanager end end end notice @old_

google maps api 3 - Infobubble only displaying content from last marker added via PHP/Mysql with tabs -

i've been trying infobubbles work 2 tabs on map populated markers mysql database ajax call. the problem every infobubble displaying same content in tabs, last marker added. here entire js script, appreciated. var script = '<script type="text/javascript" src="http://google-maps-' + 'utility-library-v3.googlecode.com/svn/trunk/infobubble/src/infobubble'; script += '.js"><' + '/script>'; document.write(script); var customicons = { free: { icon: 'http://labs.google.com/ridefinder/images/mm_20_blue.png', animation: google.maps.animation.drop, shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png' }, paid: { icon: 'http://labs.google.com/ridefinder/images/mm_20_red.png', animation: google.maps.animation.drop, shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png' } }; // end custom icons var map, i

HTML inside of external jQuery function not working -

this little hard me explain. bare me. have external javascript file loads html within div on html page: $(window).load(function(){ $('img#madhere').click(function(e) { e.preventdefault(); $('#extras').html('<ul class="animated flash"><li class="drop"><a id="infobutton" class="scroll" href="#bottomcontent"></a><div class="dropdowncontain"><div class="dropout"><ul><li><a id="show_madhere_info" href="">info</a></li><li><a id="show_madhere_credits" href="">credits</a></li><li><a id="show_madhere_trivia" href="">trivia</a></li><li><a class="twits" href="https://twitter.com/share?text=check%20out%20%22were%20all%20mad%20here%22%20on%20jick%20pictures&url=http%3a%2f%2fwww.jickpictures.com"

java - Session management in Servlets and JSP -

this question has answer here: how redirect login page when session expired in java web application? 9 answers how use sessions throughout servlets , jsps in project? when go 1 of jsp pages, exists in project, writing directly jsp file name in url, localhost:8080/xyz/abc.jsp , without validating login, jsp page opening in browser. how manage jsp pages , servlets there no access page without login authentication? i suggest way build filter . can used run code before , after request handled servlet or jsp. can build filter checks user's session valid and, if not, redirects user login page or "unauthorised" page. save adding authentication logic every jsp file want protect. maybe this blog post helpful.

IOS Storyboards: Restoration ID just like Storyboard ID? -

i'm using ibook 'ios storyboards' steinberg transition using storyboards. on page 30, author's tutorial shows setting 'storyboard id' in identity inspector, value - of redscene. in book graphic shows first field under 'identify' in xcode 4.6.1 don't see 'storyboard id', see field called 'restoration id', set value 'redscene'. use value in viewcontroller.m - (ibaction)redbuttontapped:(id)sender { uiviewcontroller *redviewcontroller = [[self storyboard] instantiateviewcontrollerwithidentifier:@"redscene"]; [self presentviewcontroller:redviewcontroller animated:yes completion:nil]; } however, when run app, error right on line refer 'redscene'. set exception breakpoint , see (lldb) i'm not sure @ in values displayed debugger on left side, have idea code doesn't know 'redscene' is. i'm starting learn use apple documentation, i'm still uncertain how locate rig

android - Open settings screen to activate input method -

i have written custom input method (soft keyboard). can check whether it's enabled or not based on this post . if it's enabled (but not current ime) can call imemanager.showinputmethodpicker(); displays list of enabled imes user can pick mine. however, if ime not enabled in system settings, rather take user directly system settnigs screen can enable ime (i remember swiftkey after installing). how can open specific settings screen? you can open android settings. use below code import android.provider.settings; ctx.startactivity(new intent(settings.action_input_method_settings));

xml - how can we avoid enhancing while using datanucleus? -

i trying implement jdo datanucleus using xml mapping. avoiding annotations because needs enhancing. there way can avoid enhancing step , still use datanucleus? no idea you've been reading. datanucleus requires bytecode enhance classes full stop . isn't annotations need enhancing, , xml doesn't .... totally wrong. it's trivial post-compile step. enhancement common-place in java these days, used spring, eclipselink, openjpa, guice, , many other known software packages. heck, hibernate provides (and thats after them branding "evil" 10 years ago hehe)

how to get user timeline posts using facebook api android -

i m using facebook api in android post/share status on user wall. want status user time line m using following code after sucessfull login , geting accestoken. jsonobject json = util.parsejson(mfacebook.request("me")); string facebookid = json.getstring("id"); string facebookemail = json.getstring("email"); string facebooklastname=json.getstring("last_name"); string facebookfirstname=json.getstring("first_name"); string fusername = json.getstring("username"); this returns me things correctly , how can posts user timeline. you can user information using url https://graph.facebook.com/ {your friends fb id}/posts but before using this,you have permissions.

.net - IDE for Common Intermediate Language (CIL) -

is there ide editing cil-code? i'm looking specific ide embedded compiler/decompilder, syntax highlighting, embedded documentation etc. ildasm+sublime+ilasm no me. there extesnsion support il: il support also take @ xacc .

javascript - how to set dd-MM-yyyy formate in ajaxToolkit CalendarExtender -

i using ajax toolkit calendar extender.and need dd-mm-yyyy date formate. write code code <asp:textbox cssclass="tb10" id="txtdtfrom" runat="server" width="130px"></asp:textbox> <asp:imagebutton id="imgfrom" runat="server" imageurl="~/gridviewcssthemes/images/calendar_schedulehs.png" causesvalidation="false" /> <ajaxtoolkit:maskededitextender id="maskededit_dtfrom" runat="server" targetcontrolid="txtdtfrom" mask="99-99-9999" masktype="date" acceptampm="true" displaymoney="left" acceptnegative="left" errortooltipenabled="true" cultureampmplaceholder="" culturecurrencysymbolplaceholder="" culturedateformat="" culturedateplaceholder="" cu

indexing - Can I force merge index in Mysql -

i have query looking select fld table id > 50000 , fld_1 = 0 limit 1000 both id , fld_1 indexed. using either 1 of them better result? force index using 1 of them. i referring - http://dev.mysql.com/doc/refman/5.1/en/index-merge-optimization.html#index-merge-intersection i don't know of way force index-merge. conditions on manual page describe conditions when index-merge can done, , optimizer should automatically if can (and if cost-based optimizer decides it's worth so). can't force index-merge if it's not possible. but compound index performs better index-merge anyway, better strategy. the order of columns matters. put columns equality comparisons first in index, columns inequality comparisons. create index idxfld1id on `table` (fld_1, id); see presentation how design indexes, really . you can make schema changes such creating indexes -- without downtime -- using http://www.percona.com/doc/percona-toolkit/pt-online-schema-chan

iphone - getting sender object in cocos2d -

i making game using cocos2d. using following code,i have added animation.how send ccsprite reference? if(sprite != monkey) { [self scheduleonce:@selector(animate_sprite:) delay:0.1f]; } -(void)animate_sprite:(cctime) dt { id s2 = [ccscaleto actionwithduration:0.5 scalex:2.0 scaley:2.0]; id fun = [cccallfuncn actionwithtarget:self selector:@selector(spritedone:)]; [sprite runaction:[ccsequence actions:s2,fun,nil]]; } how sprite reference in animate_sprite method? you can use performselector:withobject:afterdelay same thing. if(sprite != monkey) { [self performselector:@selector(animate_sprite:) withobject:sprite afterdelay:0.1f]; } -(void)animate_sprite:(ccsprite *)sprite { id s2 = [ccscaleto actionwithduration:0.5 scalex:2.0 scaley:2.0]; id fun = [cccallfuncn actionwithtarget:self selector:@selector(spritedone:)]; [sprite runaction:[ccsequence actions:s2,fun,nil]]; } so edit method use sprite , not cctime object since not using

In a weighted undirected graph of n nodes, what is the minimum cost of visiting any distinct k nodes? -

here different k nodes visitees, visited visitors. challenge that, number of visitors, visitors, k distinct visitees, , visiting path (from visitor visitees) need decided. rule visitee can not vistor. here several examples: if k=1, find edge minimum weight in graph, (u,v), either u visitor (then v visitee) or v visitor (then u visitee). minimum cost minimum weight. if k=2, find 2 edges minimum weights in graph, (u,v) , (u',v'). if u,v, u',v' 4 different nodes, node in 1 of 2 edges can visitor , other node visitee. if 1 node both edges same, v=u', can u visitor , v, v' visitees, or v' visitor , v, u visitees, both optimal solution. if k=3, however, finding 3 minimum weighted edges not give optimal solution. here example. say, edges (u,v), (v,u'), , (v,v') 3 edges. can u visits both v , u'. however, since v being visited, can not visitor visit v'. v' can not visitor visits v either, since v can visited once. in case, have find fou

vb.net - Print automatically after PDF is generated in c#? -

this question has answer here: how print document using printdialog in c# 1 answer generate pdf automatically prints 4 answers i'm developing billing application, in project need generate pdf, use 'itextsharp.dll' generate pdf. works fine. after pdf generation, need print pdf file automatically without action. pdf generation code follow: pdfwriter writer = pdfwriter.getinstance(document, new filestream("d:\\bill1.pdf", filemode.create)); document.open(); document.add(table1); document.close();

asp.net - textbox and label position issue -

i new asp.net , facing small problem in it. problem set textbox , label in different position , while use <br/> tag form looking bad how can resolve flow? code is: <tr> <td align="right" style="padding-right: 5px;" class="style6"> <asp:label id="lblemailid" runat="server" text="email id &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:"></asp:label> </td> <td align="left" style="padding-left: 5px;" class="style6"> <br/><br/><br/> <asp:textbox id="txtemailid" runat="server" width="70%" autocompletetype="office"></asp:textbox> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:requiredfieldvalidator id="requiredfieldva

c++ - Region of Interest Uniqueness and Identity -

i'm working computer vision application opencv. application involves target identification , characteristic determination. generally, i'm going have target cross visible region , move through in couple of seconds. should give me upwards of 50-60 frames camera in i'll able find target. we have implemented detection algorithms using swt , ocr (the targets have alphanumeric identifiers, makes them relatively easy pick out). want use of data possible 50-60 shots of each target. this, need way identify particular roi of image 2 contains same target roi image 1. what i'm asking little advice may have come across before. how can easily/quickly identify, within reasonable error margin, roi #2 has same target roi#1? first instinct this: detect targets in frame 1. calculate unique features of each of targets in frame 1. save. get frame 2. immediately rois have same features calc'd in step 2. grab these , send them down line further processing, skipping step 5.

html - Styling the radio buttons -

i want style checkboxes. able using following html markup , css. however problem have bit different html markup, cannot change. reason not being able change is generated plugin, need edit core files change that, not want do. so how can add same style html have below. working html: <input type="radio" id="radio"> <label for="radio"></label> required html: <li> <input id="option-11" type="radio" value="11"> <label for="option-11">option one</label> </li> as can see although markup similar, in above label used display text. css: input[type="radio"], input[type="checkbox"] { display: none; } input[type="radio"] + label{ background:url('http://refundfx.com.au/uploads/image/checkbox_empty.png'); padding:0; display: inline-block; width:20px; height:20px; } input[type="radio"

Where can I find firefox source code for android? -

how firefox source code android? i've found following link download package http://hg.mozilla.org/services/fx-home/ don't know whether android source code exist or not. please check wiki fennec (firefox mobile): https://wiki.mozilla.org/mobile/fennec/android build instructions , :-)

GLSL compile error "memory exhausted" -

i trying implement glsl fragment shader complex if-else decision tree. unfortunately shader compiler fails quite "syntax error - memory exhausted" error. there constraints code size or decision tree depth in glsl? suggestion how overcome issue? bool block1(float p[16], float cb, float c_b) { if(p[6] > cb) if(p[7] > cb) if(p[8] > cb) return true; else if(p[15] > cb) return true; else return false; else if(p[7] < c_b) if(p[14] > cb) if(p[15] > cb) return true; else return false; else if(p[14] < c_b) if(p[8] < c_b) if(p[9] < c_b) if(p[10] < c_b) if(p[11] < c_b) if(p[12] < c_b) if(p[13] < c_b) if(p[15] < c_b) return true; else return false; // ';' : syntax error memory exhausted else return false; else return false;

linux - How to write a multi-line shell script -

i have remote machine want replace contents of file. i using following commands ssh abc@host abc sed -i s/enable=false/enable=true/g /config/pqr.properties where abc username , password. how put in shell script? the bad way: to write expect script feed password ssh. the right way: to generate key ssh , authorization via ssh key. command like: ssh abc@host 'sed -i s/enable=false/enable=true/g /config/pqr.properties'

ocr - Does Tesseract's hOCR output really contain bounding boxes and confidence levels for each character? -

Image
in tesseract faq can: how can coordinates , confidence of each character ? there 2 options. if rather not programming, can use tesseract's hocr output format (read tesseract manual page details). but when created sample hocr output (it's .html file), bounding boxes , confidence levels available at word level . am missing here? i've added sample input/output illustration (the input resized). this input image: this tesseract's hocr output: <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <title></title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name='ocr-system' content='tesseract'/> </head> <body> <div class='ocr_page' id='page_1' title='image "in2.tif"; bbox 0 0 1882 354'> <div cl

java - Trouble with compiling JNI -

i have following c code implemented referencing header file generated jni: #include <jni.h> #include <stdio.h> #include "helloworld.h" jniexport void jnicall java_helloworld_print(jnienv *env, jobject obj) { printf("hello world!\n"); return; } when try compile (to generate library) using: cc -g -i/usr/lib/jvm/java-7-openjdk/include -i/usr/lib/jvm/java-7-openjdk/include/linux helloworld.c -o libhelloworld.so i got error: /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/crt1.o: in function `_start': (.text+0x18): undefined reference `main' collect2: ld returned 1 exit status how can fix issue? you have add -shared linker option first create object file: cc -c helloworld.c then create so cc -shared -o libhelloworld.so helloworld.o

node.js - How do I sync couchdb views? -

i starting use nodejs , couchdb, , wanted keep view functions synchronized server because want keep them in version control. i thought of rolling own solution, involving storing views along hash of own code, else must have created already. you can use couchdb replication replication filter designed select design documents.

php - How to create array using javascript with a database mysql? -

anyone can me problem thank in advance google chart need change task , hours per day dynamically, need database can connect database , put them on array how can that. <html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("visualization", "1", {packages:["corechart"]}); google.setonloadcallback(drawchart); function drawchart() { var data = google.visualization.arraytodatatable([ ['task', 'hours per day'], ['work', 11], ['eat', 2], ['commute', 2], ['watch tv', 2], ['sleep', 7] ]); var options = { title: 'my daily activities' }; va

iphone - Issue with fetching core data objects using NSPredicate -

Image
before start let me give how data model looks like: i have fetch request following predicate: nsarray *allowedpacknames = @[@"success, happiness, free"]; self.fetchedresultscontroller = [author mr_fetchallgroupedby:nil withpredicate:[nspredicate predicatewithformat:@"any quotes.quote.pack.packname in %@", allowedpacknames] sortedby:authorkeys.name ascending:yes delegate:self]; i wanted fetch authors has quote packname of success or happiness or free. author has nsset of quotes can see in relationship table below. when execute following error: coredata: error: (1) i/o error database @ /users/abdul/library/application support/iphone simulator/6.1/applications/da17421b-a54d-42e3-9694-fdcbff7f8ba4/l

javascript - Getting the file location from a web application -

i'm making new project, , not going placed on server want when user uses fileupload, link, of file user uploads... know javascript can't this.. is there other way of doing this? getting file location file input box...

url - Create iOS link to an App in the app store - best way? -

here requirements: 1. create links single app in app store 2. access links either inside app, on device (e.g. mail link) or pc (e.g. via facebook share link) 3. open links using iphone or ipad running ios 5 + i have done digging around , come following options: http://phobos.apple.com/webobjects/mzstore.woa/wa/viewsoftware?id=487547243 http://itunes.apple.com/gb/app/anyvalue/id487547243?mt=8 http://itunes.com/apps/seligmanventuresltd/mousetrapfree http://itunes.com/apps/mousetrapfree itms://itunes.com/apps/mousetrapfree itms-apps://itunes.com/apps/mousetrapfree just wondering if 1 (or some) of these better other? thanks. ok, have done lot of research/testing , here conclusion: links use in code should not rely on 'current' name of app, since might change on time (e.g. light alarm lite vs light alarm free). therefore following 4 out imho: http://itunes.com/apps/seligmanventuresltd/mousetrapfree http://itunes.com/apps/mousetrapfree itms://itu

javascript - Jquery Sortable with dynamic lists -

i have piece of script works fine relates 1 <ul> . $("#sortme").sortable({ update : function () { serial = $('#sortme').sortable('serialize'); $.ajax({ url: "includes/sort_menu.php", type: "post", data: serial, error: function(){ alert("theres error"); } }); } }); this arranges sections later need populated. each section new ul created , next items placed in corresponding section. to make new items sortable have used following code when appending new item section: $('ul.sortable.'+section+'').sortable(); this works fine , allows me reorder items within specified sections. as bit of code contained within function called when item added section problem arises want save order (as happens in top script). far have been unable fire similar function when items have been reordered. how go ac

oracle - Want to convert Dynamic PL/SQL query into static one -

in project there 1 lengthy dynamic query below- basic_query varchar2(1000); final_query varchar2(1500); where_clause varchar2(500) default null; basic_query :=<select ...from table ....> if(<condition1>) where_clause := <one_new_condition_will_be_added_in_where_clause1> elsif(<condition2>) where_clause := <one_new_condition_will_be_added_in_where_clause2> elsif(<condition3>) where_clause := <one_new_condition_will_be_added_in_where_clause3> else where_clause := <one_new_condition_will_be_added_in_where_clause4> endif; final_query :=basic_query || where_clause || '<group_by_clause'> || <'order_by_clause'>; execute immediate final_query; now client wants convert dynamic query static one. have tried using case,but it's not working properly. select ...from table condition1,and case( when(<condition1> , <one_new_condition_will_be_added_in_where_clause1&g

audio - Playing sound from a specific location in Python Tkinter -

goal to play wav file location d:1.wav , when application started user research saw following questions: how go playing alarm sound in python? play audio python what tried i tried following lines: example 1 import winsound winsound.playsound('d:\1.wav',winsound.snd_filename) ##did not work example 2 import winsound winsound.playsound('1.wav',winsound.snd_filename) ##did not work both times got default sound not sound should have played per audio file also when write winsound.playsound('1.wav',winsound.snd_filename) python check file 1.wav ? in directory? why flag winsound.snd_filename used for? specs python 2.7 tkinter 8.5 windows xp sp please me issue. change winsound.playsound('d:\1.wav',winsound.snd_filename) to winsound.playsound('d:\\1.wav',winsound.snd_filename) to prevent python escaping path: >>> = '\1.wav' >>> '\x01.wav' winsound.snd_f