Posts

Showing posts from August, 2010

android - Error Creating New Projects after installing Eclipse -

i've installed eclipse when created new project, generates following errors: workspace\appcompat_v7\res\values-v21\themes_base.xml:129: error: error: no resource found matches given name: attr 'android:colorcontrolnormal'. workspace\appcompat_v7\res\values-v21\themes_base.xml:130: error: error: no resource found matches given name: attr 'android:colorcontrolactivated'. \workspace\appcompat_v7\res\values-v21\themes_base.xml:81: error: error: no resource found matches given name: attr 'android:colorprimary'. all of them in file theme_base.xml. this first time i've had error installing eclipse. related graphics card? try reload installer, or use android studio :)

Cant set javascript cookie expiration date -

function setmoney(value) { var mydate = new date(2050, 9, 12); mydate.toutcstring(); alert(document.cookie); //i old cookie normal document.cookie = "money=" + value + ";expires=" + mydate + ";"; alert(document.cookie); //i money=987996 , dont expiration date } setmoney(987996); whats wrong here? it's code stops @ + value + bit. chaning number in method calling line still results in number change in alert know setting something. alert wont give expiration date, show value. check cookie firebug, should proper expiration date.

networking - Need help on Network Prefix and Pings -

vms _________ ip address of eth0 __________ network mask pc1 __________ 10.0.1.100 / 24 __________ 255.255.255.0 pc2 __________ 10.0.1.101 / 28 __________ 255.255.255.240 pc3 __________ 10.0.1.120 / 24 __________ 255.255.255.0 pc4 __________ 10.0.1.121 / 28 __________ 255.255.255.240 results: from pc1 ping pc3 -> successful from pc1 ping pc2 -> successful from pc1 ping pc4 -> error (100% packet loss) from pc4 ping pc1 -> network unreachable from pc2 ping pc4 -> network unreachable from pc2 ping pc3 -> network unreachable can explain why pc1 pc4 error , why pc4 pc1 network unreachable? does have network prefixes? all addresses in 10.0.1.0/24 network. putting different masks on them cause nothing grief. pc4 in network 10.0.1.112/28 can pc1 through it's gateway, therefore can't respond pings pc1. pc1 thinks it's in

MVVM with N-Tier -

i'm not sure implementation of project using mvvm, have project structure project separated projtitle.ui.wpf projtitle.viewmodel projtitle.bal projtitle.dal projtitle.bo projtitle.common bo dataobject , dal deal db, bal data processed dal, , things such as: computation,business rules,simple linq, etc. i'm not using helper dal, think old fashion way of processing/getting data database. sometimes, bal kinda redundant simple function helps operation is implementation not bad practice? you should implement in following way: wpf prj: - views - viewmodel & commands - helpers dal prj: -ef model -services classes bll: - process dal applying business logic facade: - allowing talk bll->dal , facade gonna used commands of viewmodel

java - How to make highlighted text remain highlighted when selecting another button? -

my application's mechanic highlight piece of text , press button make highlighted text answer. issue when select button, highlighted text disappears. the text want highlight within html format: <div id="passage_432" class="passage ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active" style="display: block;" aria-labelledby="passage_432_header" role="tabpanel" aria-expanded="true" aria-hidden="false"> <p>this test passage test 323</p> </div> application image the code using select text follows: webelement makeselection = driver.findelement(by.xpath(array3[9])); actions action = new actions (driver); action.movetoelement(startlocation, 0, 0); action.clickandhold(startlocation); action.movetoelement(startlocation, 3, 0); action.release(); action.perform(); makeselection.click(); edit(3/3/2016) i found weird solution. code

jsf - disable onscroll event of the icefaces datatable -

i used ice:datatable component display data, somehow there default onscroll event in target div doesn't make sense me , had brought positioning problems other float elements within page. want disable action, didn't find approach control this. it called function below: var input = document.getelementbyid('targetid'); cleartimeout(ice.pid); ice.pid = settimeout(function() { input.value = document.getelementbyid('targetid_scroll').scrolltop; window.icesubmitpartial(null, input, event); }, 400); i had similar problem icefaces , upgraded jsf , icefaces versions best solution change tags: ice:datatable tag ace:datatable , columns inside ice:column ace:column . but, if didn't upgrade icefaces version, guess use javascript or jquery in point of code removing onscroll attribute, like: document._getelementsbyxpath("//div[contains(@onscroll,'scroll')]")[0].removeattribute("onscroll") this 1 i

Android: Google Maps Android API: Authorization failure -

Image
when app tries use google maps api, following logcat error try access google map api data (scroll right see stuff!): 02-02 15:39:35.329 23868-24511/com.somepackage.name e/google maps android api: authorization failure. please see https://developers.google.com/maps/documentation/android/start how correctly set map. 02-02 15:39:35.339 23868-24511/com.somepackage.name e/google maps android api: ensure following correspond in api console: api key: ai~~~~~~~~~~~~~~~~~~~~~~~~~~zwmi​ package name: com.somepackage.name certificate fingerprint: 50:~~~~~~~~~~~~~~~~~~~~:d5 here image of google developers support console fingerprint , api key (and yes, match!). have waited google servers update (5 minutes according d

highcharts - Add Flag based on button event -

series: [{ type: 'flags', name: 'flags on axis', data: [{ x: date.utc(2011, 2, 1), title: 'a' }, { x: date.utc(2011, 5, 1), title: 'c' }], shape: 'squarepin' }] $("#btnaddflag").click(function () { chart.series[0].setdata( { x: date.utc(2011, 2, 1), title: 'b' }); }); above code part of highstock chart option , want add flag based on user event click. able add new point flag chart existing flags title , c missed out. how can add new flag chart existing flags ? on other hand, able flag data i'm unsure generate correct data structure , reinitialize old , new flag data chart. thank you. use addpoint instead of setdata. http://api.highcharts.com/highstock#series.addpoint() $("#btnaddflag").click(function () { chart.series[0].addpoint({ x: date.utc(2011, 2, 1), title: 'b' }); });

How to restrict Number Field default value set to '0' in extjs -

i using extjs 3.4, have grid use editor function , form of numberfield type. here scenario, when user starts editing number field , clears , navigating next page makes field value set '0' dirty flag set dont want. so, please me out in having control on cell edited , value updated in cells. thanks in advance, rk in extjs, when defined int field in model.its default value taken 0 .we need take of usenull property in field value true : { name: <fieldname>, type: 'int', usenull: true },

Disable a Magento mobile theme for tablet & iPad -

i made website include desktop mobile theme. works fine, in tablet & ipad shows mobile theme don't want. use following exception (iphone|ipod|blackberry|pre|palm|googlebot-mobile|mobi|safari mobile|windows mobile|android|opera mini|mobile)|(!ipad|silk|kindle|xoom|sch-i800|tablet) but shows mobile theme. please me how can call desktop theme in tablet & ipad. i try lot of strings. @ last using string: iphone|ipod|mobile problem solved. shows desktop theme in table & in mobile shows mobile theme.

node.js - Attain insertOneWriteOpResult object after operation -

https://mongodb.github.io/node-mongodb-native/2.1/api/collection.html#~insertonewriteopresult how attain insertonewriteopresult after performing insertone operation? var result = yield users.insertone({ lol: 'lol' }); console.log(json.stringify(result)); i seem object {"ok":1,"n":1} , not list specified in documentation. result object may contain values cannot stringified, values cannot stringified stripped object when try print them console.

c# - How to find all objects that implement a interface and invoke a method -

i have usercontrol have few child usercontrol 's , usercontrol 's have child usercontrol's. consider this: mainusercontrol tabcontrol tabitem usercontrol usercontrol usercontrol : isomeinterface tabitem usercontrol usercontrol usercontrol : isomeinterface tabitem usercontrol usercontrol usercontrol : isomeinterface tabitem usercontrol usercontrol usercontrol : isomeinterface this have far, finds no isomeinterface : propertyinfo[] properties = mainusercontrol.gettype().getproperties(); foreach (propertyinfo property in properties) { if (typeof(isomeinterface).isassignablefrom(property.propertytype)) { property.gettype().invokemember("somemethod", bindingflags.invokemethod, null, null, null); } } is possible find child usercontrol 's mainusercontrol implement isomeinterface via reflection , call method( void somem

git - Continuous deployment to Dev/TestProd on Azure -

Image
i have project consists of multiple components: 2 spa clients, 1 api, elasticsearch server, rabbitmq server, thinktecture identity server etc. etc. , deploy azure. code stored in git (bitbucket precise), in multiple repositories. ideally, able deploy branches, i.e 1 test/staging environment, , production. are there samples/tutorials available describe steps needed accomplish this? regards, daníel let`s see if can offer helpful information: azure app service great platform deploy spa clients , api web app. azure app service come build-in continuous deployment support, included bitbucket , can build , deploy app. , support wide range of language (.net, nodejs, go, python, php, java , on ...) another thing azre app service have slot feature , can setup ci staging slot, testing there, since swap prod deployment. if have settings/configurations specific slot, e.g different slot connect different database, can put them application settings, once create site, " h

How to escape field name in orientdb -

i'm having class fields from , to in orientdb database. how execute query select from , to fields? i tried select [from] activity complaining [ . you have disable strictsql using command: alter database custom strictsql=false and have use backtick: select `from` activity

objective c - Is there any iOS SDK equivalent of gethostbyname and inet_ntoa functions? -

i saw several questions here, is's still not clear me. , apple reject using standard gethostbyname function? it's in c standard library (at least according posix). can use c library functions in ios app.

java - Initialize H2 in-memory from a file contained in a jar? -

how initialize h2 file contained in jar? currently getting exception: testcase(checktest): org.h2.jdbc.jdbcsqlexception: io exception: "java.io.filenotfoundexception: /users/user1/.m2/repository/a/3.10-snapshot/a-snapshot-tests.jar!/h2_db.sql (no such file or directory)"; "file:/users/user1/.m2/repository/a/3.10-snapshot/a-3.10-snapshot-tests.jar!/h2_db.sql"; sql statement:(..) the file want initialize database ( h2_db.sql ) inside jar file a-3.10-snapshot-tests.jar the code looks like initsqlfile = getinitsqlfile(); //initsqlfile = "/users/user1/.m2/repository/a/3.10-snapshot/a-snapshot-tests.jar!/h2_db.sql" //initsqlfile file contained ina jar, note "!" url = string.format( "jdbc:h2:mem:%s;mode=postgresql;lock_timeout=500;ifexists=true;init=runscript '%s';db_close_delay=-1;mvcc=true", testsuitname, initsqlfile); // later ... con = drivermanager.getconnection(url, user, passwd); th

java - Report comes two pages when using subreport -

i have problem when using subreport in report. have query produced 1 record. , i've arranged 1 record displayed 1 page. when there subreport, prints 2 pages, wherein second page blank. , see following exception: apr 01, 2013 5:45:25 pm net.sf.jasperreports.view.jrviewer paintpage severe: page paint error. net.sf.jasperreports.engine.jrruntimeexception: net.sf.jasperreports.engine.jrexception: image read failed. @ net.sf.jasperreports.engine.export.draw.printdrawvisitor.visit(printdrawvisitor.java:143) @ net.sf.jasperreports.engine.export.draw.printdrawvisitor.visit(printdrawvisitor.java:57) @ net.sf.jasperreports.engine.fill.jrtemplateprintimage.accept(jrtemplateprintimage.java:442) @ net.sf.jasperreports.engine.export.draw.framedrawer.draw(framedrawer.java:251) @ net.sf.jasperreports.engine.export.draw.framedrawer.draw(framedrawer.java:199) @ net.sf.jasperreports.engine.export.jrgraphics2dexporter.exportpage(jrgraphics2dexporter.java:273) @ net.

latitude longitude - Moving Collada file Lat Long -

i append collada file plug-in, , move (append.child, remove.child, append.child, etc) based on small latitude , longitude increments. when latitude increment = longitude increment, however, file moves in rectangular fashion , not square fashion. doing wrong? shouldn't "path" collada file travels "square"? the increment in both directions (lat or long) same increment (0.00001499817). in trying figure out, noticed "circle" polygon code shows oval unless place along equator. should assuming latitude increment equals longitude increment in earth??? anybody know might going on? thanks. paul should assuming latitude increment equals longitude increment in earth??? do assume earth perfect sphere? do assume latitude , longitude lines evenly spaced out? to quote else quick google search longitude east-west (right/left) measurement on map. goes 180 degrees west 0 (through greenwich, london, uk) 180 degrees east. 1

excel - Trying to find a string in a file -

i'm looking free tool can use find string in excel file. tried notepad++, , didn't work. tried agent ransack, , that's didn't work. the intentionally entered string xlsb file, , ran both notepad++ , agent ransack, , neither utility can find string. found in word doc, not in excel file. is there free utility can download find string within excel file? thanks. if rename xlsx file extension zip, can access zip content , you'll find xml called sharedstrings.xml , can search in using notepad++, notepad, or other text editor. hope helps you.

hta - How to make ckeditor work offline -

the jqwidget "jqxedit" works in html application (.hta) several imperfections. therefore try ckeditor. ck editor window , toolbar shows fine on "congratulations" page, alert script error "unable property 'tools' of undefined or nul reference" appears. has figured out modifications scripts make ckedit work offline? do have code run server side? maybe need set local http server (for example using xampp).

asp.net mvc - Generate list in view and pass it to controller -

i'm writing hotel reservation web site asp.net , mvc 4. have class named reservation have list of contacts. in create view want dynamically create contacts. (number of contacts = adults + kids , determined in create reservation view) how post contact information controller? public partial class reservation { public int id { get; set; } public int roomtype_id { get; set; } public system.datetime fromdate { get; set; } public system.datetime todate { get; set; } public byte adults { get; set; } public byte kids { get; set; } public decimal price { get; set; } public int user_id { get; set; } public int state_id { get; set; } public virtual reservationstate reservationstate { get; set; } public virtual roomtype roomtype { get; set; } public virtual user user { get; set; } public virtual icollection<transaction> transactions { get; set; } public virtual icollection<contact> contacts { get; set; } } should set

database - how to read csv file from server using javascript -

i trying read data online database http://coxpresdb.hgc.jp/top_search.shtml#coexsearch , under coexsearch. when enter id, says 1717, give .csv file. how can use javascript read csv file directly ( initalize array). thanks.

jquery Validation on Enter key not working -

when use submit button on form validated validation form run expected. when use enter key instead of submit button validation not work properly. form gets submitted out checking validation . how can solve problem ? $(function () { /* varable declarataion..... */ var $pin = $("#pincode").attr("name"); var $params = {debug:false, rules:{}, messages:{}}; $params['invalidhandler'] = function(form, validator) { jquery(document).scrollleft(300) ; jquery(document).scrolltop(100); var posx = jquery(document).clientwidth/2; var posy = jquery(document).scrolltop()+(jquery(document).clientheight/2); $("#dialog-confirm").dialog({ resizable: false, height:180, modal: true, position:[posx,posy], buttons: { "ok": function() { $( ).dialog( "close" ); } }

php - Login throw curl and browser -

i'm working drupal 7 , rest api. i'd log in drupal curl , later when visit website browser want logged in. i'm usin gthis code: <?php $user_data = array( 'username' => 'usertest', 'password' => 'pass', ); $ch = curl_init(); $tmpfname = dirname(__file__).'/'.$_cookie['phpsessid'].'.txt'; curl_setopt($ch, curlopt_url, "http://example.com/networklogin/user/login"); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_postfields, $user_data); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt( $ch, curlopt_cookiesession, true ); curl_setopt( $ch, curlopt_cookiejar, $tmpfname ); curl_setopt( $ch, curlopt_cookiefile, $tmpfname ); $response = curl_exec($ch); $http_code = curl_getinfo($ch, curlinfo_http_code); curl_close($ch); ?> and works pretty well, logs user in, when visit "example.com" i'm not logget in "usertest". there way log me drupal , a

python - rpy2 and R debugging -

after trouble installed rpy2. my aim build models (gam; library mgcv of simon wood) , use predict function passing pandas dataframe python through rpy2 gam model , retrieve prediction. the r script tested loading txt file , process through same r functions called python/rpy2 script , works fine. in python script start pickled version of text file (as if in final code, starting pandas dataframe). i capable of triggering other errors in r script make sense (passing empty dataframe, or dataframe column missing perform prediction both trigger error in r.) gam function input data intact. i close finish, keep getting error: error in extractdata(object, data, null) : 'names' attribute [1] must same length vector [0] i don't know way more feedback r in python script. how can debug? or can point me out might problem in r? or part of ".convert_to_r_dataframe()" function not grasp completely??? r-code: f_clean_data <- function(df) { t = df

c# - execute while block until one of three conditions raises -

i want actions until 1 of following conditions satisfied^ html.indexof("/>")==0 html.indexof("</"+tagname+">")==0 html[0]=='<' where here html actualy string. have tried - apply or operation inversed conditions. wrong. how properly. here's code: while((html.indexof("/>")!=0)&&(html.indexof("</"+tagname+">")!=0)||(html[0]!='<')) { html = html.remove(0, 1); } you mixing , and or reason. have while(a && b || c) but want write while(a && b && c) the code should read: while ( (html.indexof("/>")!=0) &&(html.indexof("</"+tagname+">")!=0) &&(html[0]!='<')) i echo @cdhowie's comment. using html parser make code easier read , write, , make more robust varied input.

Cannot resolve Symbol variables - Tearing my hair out -

i trying follow tutorial , have got stuck figure last error before completion. can tell me doing wrong these variables? including both activities below, if other code applicable, happy provide it. error codes read: error:(21, 56) error: cannot find symbol variable pickupline error:(24, 9) error: cannot find symbol variable retrybutton error:execution failed task ':app:compiledebugjavawithjavac'. compilation failed; see compiler error output details. mainactivity.java: package io.wavey.pickuplesson1; import android.content.intent; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.view; import android.widget.button; public class mainactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // grab clean button can stuff it! button cleanbutton = (button) findviewbyid(r.id.cleanbutto

android - How can I store a Date object in SharedPreferences? -

i need put date object in shared preferences editor. what datatype convert storing in shared preferences? write prefeditor.putstring("idetails1", idetails1); string , elements. how do that? can use date object too? private edittext pdisplaydate; private imageview ppickdate; private int pyear; private int pmonth; private int pday; /** integer uniquely define dialog used displaying date picker.*/ static final int date_dialog_id = 0; date date; private datepickerdialog.ondatesetlistener pdatesetlistener = new datepickerdialog.ondatesetlistener() { public void ondateset(datepicker view, int year, int monthofyear, int dayofmonth) { pyear = year; pmonth = monthofyear; pday = dayofmonth; updatedisplay(); displaytoast(); } }; private void updatedisplay() { pdisplaydate.settext( new stringbuilder() // month 0 based add 1 .append(pmonth + 1).append("/") .append(pday).append("/&

In Android, how to place image at center on a button without stretching? -

Image
in android layout file, have button. , want present image button without text. problem have is, image stretched cover whole button area. instead of stretching, i'd have button placed @ center of button without distortion image. <button android:layout_width="38dp" android:layout_height="match_parent" android:background="@drawable/icon_more" android:id="@+id/button" android:layout_alignparenttop="true" android:layout_alignparentend="true" /> right now, looks this: it's horizontally stretched, not want. using imagebutton choice you. can try: <imagebutton android:layout_width="38dp" android:layout_height="match_parent" android:src="@drawable/icon_more" android:scaletype="centerinside" /> flexibly combining attributes layout_width, layout_height , scaletype helps ui

How can I create an Image viewer like this in sencha touch? -

Image
i need create image viewer in sencha touch. should show thumbnails of images. clicking thumbnails should show enlarged image. i'm newbie in sencha touch. please me. afaik there no such standard gallery plugin have yourself. can try this: create container 2 panels in vbox layout, bigger top panel have image , lower panel horizontal list . on itemtap of list item, can change src attribute of image . can create simple list loading data server using store provides both thumbnail & big image url. i haven't tested should this: { xtype : 'panel', layout : 'vbox', items : [{ xtype : 'panel', flex : 5, items : [{ xtype : 'image', id : 'myimg', src : 'http://xyz.com/asdf.jpg' }] },{ xtype : 'panel', items : [{ xtype : 'list', listeners: { itemtap: function(list, i

ios - Coredata chained Relationship -

Image
what best way update or add data if relationships chained. i have coredata designed this: i have 3 entities 1) user to_many category 2) category to_many item 3) item to_one category user required before adding category , , category required before adding item simple. set to-one relationship, corresponding inverse relationship set automatically core data. newitem.category = category category.user = user according best practice, renaming clumsy attribute names itemcategory , categoryuser , categoryinuser category , user , categories respectively.

c - How to avoid including "-D_BSD_SOURCE" in compile statement every time the code is compiled? -

to avoid whole bunch of strdup errors, have include -d_bsd_source in compile statement. there way can somehow include in .c file , never include in compile statement again. at top of .c file, before includes, put this: #define _bsd_source

regex - How can I simulate a negative lookup in a regular expression -

i have following regular expression includes negative ahead. unfortunately tool i'm using not support regular expressions. i'm wondering if possible achieve negative ahead behaviour without using one. here regular expression: (?<![abcdeq]|\[|\]|\w\w\d)(\d+["+-]?)(?!be|aq|n)(?:.*) here working sample data on regex101.com: see expression on regex101.com i'm using tool called alteryx. documentation indicates uses perl, however, whatever reason ahead not work. alteryx appears use boost library regex support, , boost documentation says lookbehind expressions must have fixed length. it's more restrictive php (pcre), allows use alternation in lookbehind, long each branch fixed-length. that's easy enough around: use multiple lookbehinds: (?<![abcdeq])(?<!\[)(?<!\])(?<!\w\w\d)(\d+["+-]?)(?!be|aq|n)(?:.*) that regex works me in boost-powered regex tester, yours doesn't. compress little more putting square brackets

ruby on rails - URI::InvalidURIError while i am testing with rspec+capybara -

i testing rspec+capybara, i've got error: failure/error: page.should have_selector('title', :text => "yourpos | about") expected #has_selector?("title", {:text=>"yourpos | about"}) return true, got false # ./spec/requests/static_pages_spec.rb:14:in `block (3 levels) in <top (required)>' and static_pages_spec.rb require 'spec_helper' describe "static pages" describe "about page" "should have title 'about' " visit '/static_pages/about' page.should have_selector('title', :text => "yourpos | about") end end end and app/views/static_pages/about.html.erb <!doctype html> <html> <head> <title>yourpos | about</title> </head> <body> <p>find me in app/views/static_pages/home.html.erb</p> </body> </html> wish me, lot

arduino - Functions used in ASF instead of IODIR, IOSET, PORTD -

i have programmed microcontroller before , used instructions iodir, ioset, portd, ddrd , etc. using arduino due have atsam3x8e cortex m3 microcontroller. iam programming arduino due using atmel studio 6. have figured out sam3x microcontroller don't use iodir, ioset, portd. question if functions corresponds iodir, ioset , portd. using atmel software framework (asf) program. for example how do using atmel software framework (asf): portd &= ~(1 << rs); check out gpio driver in asf under sam/drivers/gpio. contains functions gpio_set_pin_high(pin) , gpio_set_pin_low(pin) used control io pins.

java - Why don't revalidate() & repaint() work like I expect? -

i expect once combobox has been selected, jtable change. here part of code: …… chooseaccoutingitemcombobox.addactionlistener(new actionlistener() { @override public void actionperformed(actionevent e) { changetable(); jscrollpane.revalidate(); jscrollpane. repaint(); } private void changetable() { jtable accounttable2 = new jtable(accountbook.getrowdata(startyear, startmonth, endyear, endmonth, (accountingitem) chooseaccoutingitemcombobox.getselecteditem()), accountbook.getcolumnnames()); accounttable = accounttable2; } }); accounttable = new jtable(accountbook.getrowdata(startyear, startmonth, endyear, endmonth, accountintitem), accountbook.getcolumnnames()); jscrollpane = new jscrollpane(accounttable); add(jscrollpane, borderlayout.center); …… and when selected item in combobox, jtable didn't change. why

How do I know my Facebook ID - I have two?? A Long "1015443**********" and short "6045*****" one -

i'm using tool (simplesamlphp) sign in facebook. attributes have indicate facebook uid "1015443**********", when use tools online ( http://findmyfbid.com ) i'm seeing shorter "6045*****" number. need ensure i'm using id not change user (as understand users can change email in facebook). ideally i'd rather use long number that's have authentication tool. the id findmyfbid.com "real" id, doing not allowed on facebook: scraping. because can "real" id source code of profile page. the id in apps "app scoped id", , it´s id in apps. it´s different per app. check out changelog more information: https://developers.facebook.com/docs/apps/changelog#v2_0

html - textbox value cannot be change using javascript -

this question has answer here: why jquery or dom method such getelementbyid not find element? 6 answers document.getelementbyid("name").value = data; it shows uncaught typeerror: cannot set property 'value' of null. why happen? the data have value. you're receiving error because there doesn't exist element if id of name when piece of javascript executing. document.getelementbyid("name") returning null since no element found specified id. attempt access property value of null , doesn't exist. what's happening javascript code executing before element exists (move script end of body or inside document ready function, or mis-typed id.

ios - Is there a way to retrieve a list of in-app purchases made with my app? -

suppose there app in-app purchase uses web server verify in-app purchases apple , keep records. suppose web server had bug , wasn't processing purchase verification. suppose bug discovered , fixed. does apple provide sort of api retrieving list of purchases made app verification can re-run , end users credited purchases? far googling things "ios in-app purchase retrieve list of purchases" hasn't turned much. (yes, said app ought have been logging information invalidating need such api). edit: clear, i'm looking see if there's way purchase verification server , not involve client devices.

javascript - SyntaxError: Unexpected token u at Object.parse (native) in Ionic -

Image
i keep on encountering error: recipeservice.js recipedetails: function(recipe_id) { $http({ method: 'post', header: { 'content-type': 'application/x-www-form-urlencoded' }, url: 'http://localhost/admin-recipick/home/ajaxselectrecipes', data: recipe_id }).then( function success(response) { returnrecipedata = response.data; console.log(response.data); }, function error(response) { returnrecipedata = response.data; console.log(response.data); // handle error } ); } controllers.js $scope.recipedetails = function(recipe_id) { var getdatarecipe = getrecipeservice.recipedetails(recipe_id); if (getdatarecipe != "null") { recipeservice.setobject('recipick', getdatarecipe); var s = recipeservice.getobject('recipick'); console.log(s)

c - Segmentation Fault (core dumped) printing string from argv -

i'm trying check commandline arguments , see if works in command line. works fine if execute './a.out hello' when './a.out' error. #include <stdio.h> int main(int argc, char * argv[]){ printf("test"); printf("\n%s",argv[0]); printf("\n%s",argv[1]); return 0; } the reason why i'm doing because i'm going take string , compare later on. don't understand why simple causing error. you're not checking length of argv before dereferencing second argument. if argv has 1 element argv[1] null reference, causes fault. with c everything needs done carefully. answer question, yes, if statement right approach if want handle command line yourself. argc parameter main() provided purpose. #include <stdio.h> int main(int argc, char * argv[]){ printf("test"); if (argc > 0) { printf("\n%s", argv[0]); if (argc > 1) { printf("\n%s", a

Handling Exception when bulkwrite with ordered as False in MongoDB java -

i using mongo db java driver: collection.bulkwrite(documents); i have 1000000 records inserted.if insertion of 1 of records failed on first failure remaining records wont inserted.. in order avoid found there bulkwrite options ordered false; collection.bulkwrite(documents, new bulkwriteoptions().ordered(false) ) if exception occurs during above operation.can list of records bulkwrite failed , can try inserting records again:? all bulkwrite operations fail reported in arrays in return document, along full document failed insert. example, code via java driver: mongocollection<document> collection = database.getcollection("bulk"); list<writemodel<document>> writes = new arraylist<writemodel<document>>(); writes.add(new insertonemodel<document>(new document("_id", 1))); writes.add(new insertonemodel<document>(new document("_id", 2))); writes.add(new insertonemodel<document>(new document

Marionette CRUD examples -

i trying develop backbone marionette application , need know how crud (create, read, update , destroy) actions in best way. cannot find resources explaining (only backbone). any examples out there? marionette library on top of backbone think jqueryui jquery , aims scale aplication allowing modularize it, among other things saving writing lot of repetitive code. there wont lot of crud exameples, exampels try prove benefits of marionette. however think 2 tutorials you. http://davidsulc.com/blog/2012/04/15/a-simple-backbone-marionette-tutorial/ http://davidsulc.com/blog/2012/04/22/a-simple-backbone-marionette-tutorial-part-2/ http://davidsulc.com/blog/2012/05/06/tutorial-a-full-backbone-marionette-application-part-1/ http://davidsulc.com/blog/2012/05/13/tutorial-a-full-backbone-marionette-application-part-2/

php - How To Get ALL Minimum Value Within Multidimensional Array? -

i have code : <?php $result = array ( array ("split" => "2", "combo" => "4,3"), array ("split" => "2", "combo" => "6,1"), array ("split" => "3", "combo" => "2,1"), array ("split" => "4", "combo" => "1,1,1,1")); $min_x = min ( array_column( $result, 'split' ) ); print_r($min_x); ?> this give me 2 result , need create function combo value of 2 , how both array value of 2 using native php function (is there any?) : array ( array ("split" => "2", "combo" => "4,3"), array ("split" => "2", "combo" => "6,1")); you can minimum number using min , array_column , use array_filter $result = array ( array ("split"

PHP get string between tag [Multiple tag in one string] -

i've been searching lot cannot find similar problem. i've found link don't think answered question. let have string $my_string = "i [id]123[/id] , [id]456[id]"; i want number between [id][/id]. have function string between. function get_string_between($string, $start, $end){ $string = ' ' . $string; $ini = strpos($string, $start); if ($ini == 0) return ''; $ini += strlen($start); $len = strpos($string, $end, $ini) - $ini; return substr($string, $ini, $len); } $fullstring = 'i [id]123[/id] , [id]456[id]'; $parsed = get_string_between($fullstring, '[id]', '[/id]'); but function returns first string found on $fullstring. maybe can 123,456 or in array form array('123','456'). stuck this. you can use preg_match_all function of php along following regex ~\[id\](.*?)\[\/id\]~ like as $my_string = "i [id]123[/id] , [id]456[/id]"; preg_match_all("

google app engine 1.7.6 memcache viewer (Python) -

i've been having trouble memcache viewer after updating python dev appserver google app engine 1.7.6 (with python 2.7). it appears memcache isn't updated or isn't readable. have tried view memcache app engine memcache viewer when input memcache key error. when flush cache proceeds normal until memcache needs read again... the hit ratio , memcache size increases normal, there in cache. when revert app engine 1.7.5 works fine. perhaps else has had issue? when input memcache key following: traceback (most recent call last): file "c:\program files (x86)\google\google_appengine\lib\webapp2-2.5.1\webapp2.py", line 1536, in __call__ rv = self.handle_exception(request, response, e) file "c:\program files (x86)\google\google_appengine\lib\webapp2-2.5.1\webapp2.py", line 1530, in __call__ rv = self.router.dispatch(request, response) file "c:\program files (x86)\google\google_appengine\lib\webapp2-2.5.1\webapp2.py", line 1278,

Add nullable column to SQL Server with default value of null -

i want add nullable boolean column existing table default value of null. i have used bit of script not set default value null. sets 0 instead. add newcolumnname bit null constraint df_tablename_newcolumnname default(null) i ran example code snippet on sql server 2008 r2 instance , inserted record. initialized column null, expected. next step post alter statement , insert statement used. i used: alter table tmp1 add newcolumnname bit null constraint df_tablename_newcolumnname default(null) insert tmp1(emp_id) values(9999) select * tmp1 after running above, used sql server management studio "design" action examine properties of new column. showed "default value or binding" indeed (null) expected.

javascript - embed swf in jquery ui modal dialog -

i'm embed swf jquery ui modal dialog, when open dialog swf played, , when close dialog, , reopen dialog without refresh page, swf did not loaded first. want swf reopened first when close , open dialog this code of dialoge: $( "#quiz" ).dialog({ open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }, autoopen: false, resizable: false, draggable: false, modal: true, width: 750, height:350 }); $( "#quiz-link" ).click(function( event ) { $( "#quiz" ).dialog( "open" ); event.preventdefault(); }); }); try rebuilding html of dialog each time open/close it. think you're showing & hiding currently, never resets. try out instead: $( "#quiz-link" ).click(function( event ) { // create clone of dialog var quiz_clone = $( "#quiz" ).clone().appendto(body); quiz_clone.dialog({ open: function(event, ui) { $(".ui-d

javascript - How to increment div id value? -

i have got task set menu selected. use dynamic id. want increment respect selection my code is <div class="menuheader ui-corner-top" id="menu"+ i> <span><a href="#" onclick="home()">home</a></span> </div> <div class="menuheader ui-corner-top" id="menu"+ i> <span><a href="#" onclick="newtransaction()">new transaction</a></span> </div> <div class="menuheader ui-corner-top" id="menu"+ i> <span><a href="#" onclick="portfolio()">portfolio</a></span> </div> javascript is $(document).ready(function () { alert(document.url); var list = $("#menu"); (var = 1; <= list.length; i++) { list[i].innerhtml = i; } var str = document.url.tolowercase().indexof(&quo

javascript - Make the selected option uppercase in a dropdown using vanilla JS -

i need make text uppercase on selected option only in <select> . found working example using jquery need convert vanilla js . i've got pretty close, when choose option, makes selected value uppercase. when choose another, leaves previous option uppercase also. i can't figure out how "capitalise options except selected option, uppercase". any guidance appreciated. here working fiddle of far . how using css * { font-family: arial; } select option { text-transform: capitalize; } select, select option:checked { text-transform: uppercase; } <select name="title" id="title"> <option selected="" disabled="">categories</option> <option value="photo-galleries">photo galleries</option> <option value="photography">photography</option> <option value="romeo-juliet">romeo &amp; juliet<

css - What is the difference between susy-breakpoint and susy-media? -

the difference seems can pass new grid susy-breakpoint 's second argument. why not use susy-breakpoint , leave off second argument? simply put: in scenario(s) opt use susy-media on susy-breakpoint ? related docs: http://susydocs.oddbird.net/en/latest/toolkit/#breakpoint susy-media our built-in media-query handling. susy-breakpoint built integrate popular breakpoint plugin, before susy-media existed. if have breakpoint installed, susy-breakpoint call on more complex , powerful media-query syntax. if not using breakpoint, susy-breakpoint calls susy-media , , using alias.

c# - Execute a recurring job in Hangfire every 8 days -

Image
is possible create recurring job in hangfire executes after given number of days, 8. the nearest found execute job once in week - recurringjob.addorupdate("myjob",() => scheduledjob(), cron.weekly()); understanding hangfire accepts standard cronexpression , i've tried exploring cron expression frequency couldn't found 1 it- https://en.wikipedia.org/wiki/cron one ugly solution create 3 or 4 jobs executes once in month @ dates accordingly, don't want that. any suggestions please. finally have used cronexpression schedule recurring job frequency of every 8 days or number of days matter. string cronexp = "* * */8 * *"; recurringjob.addorupdate("myjob",() => scheduledjob(), cronexp); the third segment in cronexpression represents day of month. the respective segments follows - (ref: https://en.wikipedia.org/wiki/cron )

JQuery Slide element and clone to create 'infinite' loop -

i having issue feel on complicating. have container div houses inner div. inner div has background image slides left. once div reaches point want clone give seamless appearance of infinite loop. jsfiddle: http://jsfiddle.net/9phzt/ here non-working code have @ point: function moveplatform() { $("div."+theplatform).animate({"left": "-3000px"},5000,"linear", function() { $(this).remove(); }); } function cloneplatform() { var clonepoint = 3000 - thewidth; var theright = getposition(theplatform); if (clonepoint < theright) { $("div."+theplatform).clone().appendto("div#container"); } } function getposition(el) { var theleft = $("div."+el).offset().left var theright = $("div."+el).offset().left + $("div."+el).width(); //return theleft return theright } an issue functionality create endless clones based on if statement parameters. looking

comments - htmlcommentbox on blogger, how to treat ?m=0 and ?m=0 as normal post (.html) -

i found fast , wordpress comments system blogger. it's www.htmlcommentbox.com but treat ?m=0 , ?m=1 different pages. technically have 3 comment box single post. this script (it may not show text here) <!-- begin comments --> <div id="quickfever comments"> <div id="hcb_comment_box"><a href="http://www.htmlcommentbox.com">please wait,</a> we're loading comments...</div> <link rel="stylesheet" type="text/css" href="//www.htmlcommentbox.com/static/skins/bootstrap/twitter-bootstrap.css?v=0" /> <script type="text/javascript" id="hcb"> /*<!--*/ if(!window.hcb_user){hcb_user={};} (function(){var s=document.createelement("script"), l=hcb_user.page || (""+window.location).replace(/'/g,"%27"), h="//www.htmlcommentbox.com";s.setattribute("type","text/javascript");s.setattribu

android - updating or inserting in a table with keeping the row numbers to one -

i trying see if there in table update , if not insert 1 row. have 1 row in table. public void createorupdate(long id,string x, string y, string angle){ string[] columns= new string[]{key_rowid, key_x, key_y, key_angle}; cursor c= ourdatabase.query(database_table, columns, null, null, null, null, null); contentvalues editcon = new contentvalues(); if (c!=null){ editcon.put(key_x, x); editcon.put(key_y, y); editcon.put(key_angle, angle); ourdatabase.update(database_table, editcon, key_rowid + "=?", new string[]{string.valueof(id)}); } else{ editcon.put(key_x, x); editcon.put(key_y, y); editcon.put(key_angle, angle); ourdatabase.insert(database_table, null, editcon); } } public string getdata() { // todo auto-generated method stub

sql - Select first record with aggregate functions -

i have thermometer starts logging data every morning whenever machine turns on. i select min, max, , average temperatures, temperatures when machine turns on , off every day. my table structure follows: time logged, date logged, temperature i group date logged aggregates day, can't seem find way select temperature @ first , last time stamps recorded. any help? you want use windows function this: select t.datelogged, min(t.temperature), max(t.temperature), avg(t.temperature), max(case when t.seqnum_asc = 1 t.temperature end) firsttemperature, max(case when t.seqnum_desc = 1 t.temperature end) lasttemperature, (select t.*, row_number() on (partition datelogged order timelogged) seqnum_asc, row_number() on (partition datelogged order timelogged desc) seqnum_desc t ) t group t.datelogged order datelogged what doing adding 2 new variables. 1 enumerates values during day starting @ 1 first reading ( seqnum_asc

node.js - Cannot find module 'C:\server.js' -

i got following error.i searched , tried couldn't fix problem. c:\>node server.js module.js:340 throw err; ^ error: cannot find module 'c:\server.js' @ function.module._resolvefilename (module.js:338:15) @ function.module._load (module.js:280:25) @ function.module.runmain (module.js:497:10) @ startup (node.js:119:16) @ node.js:901:3 my server.js var http = require('http'); http.createserver(function (req, res) { res.writehead(200, {'content-type': 'text/plain'}); res.end('hello world\n'); }).listen(1337, '127.0.0.1'); console.log('server running @ http://127.0.0.1:1337/'); how can run server.js node.i have installed node.js , typed command prompt npm install socket.io. seems ok. please help. you didn't save server.js file in c: . use cd <dir> correct directory, try node command again.

Symfony 2: how to make firstname and lastname in one column in Symfony2? -

now have firstname , lastname fields, how make firstname , lastname in 1 column in symfony2? for example: label = fullname input box = firstname input box + lastname input box error message = fullname error message, based on firstname , lastname like datatime. read documentation on form theming: http://symfony.com/doc/2.0/cookbook/form/form_customization.html

Servlet - File location -

i working servlet in eclipse (dynamic web project) . have placed image file in web content folder sub-folder pics. there images pic1.jpg , etc. bufferedinputstream bin = new bufferedinputstream(new fileinputstream(new file(location))); what location should give in order retrieve these files? try this servletcontext ctx=getservletcontext(); inputstream in = ctx.getresourceasstream("/pics/pic1.jpg"); getresourceasstream() requires start "/" represents root of web app.

jquery - On minimizing the screen, the table should shrink -

i have table like <form id="form1"> <table style="width:75%;font-size:15px;" align="center" id="info" > ... </table> </form> on shrinking browser, want fit table accordingly. tried keeping position: relative. still doesn't work. leads ? you have give width of table directly. <form id="form1"> <table width="500" border="1" align="left" id="info" > <tr> <td>1</td> <td>2</td> </tr> <tr> <td>3</td> <td>4</td> </tr> </table> </form>

jquery - Not able to remove the space between navbar and the dropdown menu even after using border : none; -

Image
i have space between nav bar , dropdown menu. have remove space , insert line. here screen shots: i want menu this: here code: <div class="navbar-collapse collapse in" id="navbar-ex-collapse" style="height: auto;"> <ul class="nav navbar-nav navbar-right nav-pull-right"> <li><!-- ngif: loggeduser --><a style="margin-right: 100px;margin-top: px;border-bottom: black;" data-ng-if="loggeduser" class="ng-binding ng-scope"> <span class="fa fa-user iconalign font-icon-size">&nbsp;</span>shrivatsav, deeksha</a><!-- end ngif: loggeduser --> </li> <li><!-- ngif: loggeduser --><div data-ng-if="loggeduser" class="ng-scope"> <!-- <button data-ng-click="logout()" typ

javascript - HighCharts Loading from CSV File with Many Data Points -

after searching , wanting bang head against desk, i'm posting first question on stackoverflow. i've got asp.net web application generating data on server side , creating csv file on server. i'm using highcharts produce graph. working great, however, depending on kind of date range user runs there can few data points or many data points. the problem comes in when there many data points. @ x-axis, , you'll see mean. there anyway "group" these doesn't show every single point on x-axis? the dates @ random intervals. i've created jsfiddle client side code , contents of csv file in javascript variable. here code: function parsedate(datestr) { var matches = datestr.match(/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/) return date.utc(matches[3], matches[1]-1, matches[2]); } var csv = 'chart,3/4/2007,3/24/2007,4/13/2007,4/25/2007,9/19/2007,9/28/2007,11/5/2007,1/7/2008,1/14/2008,1/21/2008,1/27/2008,2/3/2008,2/10/2008,2/17/2008,2/24/2008