Posts

Showing posts from July, 2015

amazon web services - Aws public ip in runing instance -

when ifconfig in ec2 instance private ip. adding sites-available in apache need public ip. is there way can public ip in running instance. there "magic ip" on amazon ec2 instaces can curl metadata instance. to public ip of current instance can do: curl http://169.254.169.254/latest/meta-data/public-ipv4 you can read full documentation here .

jsf 2 - IceFaces Window scope not working properly on some browsers -

i running weird problems when using window scope in icefaces 3.3. when put debug statements on constructor , destroy method (using pre-destroy annotation), seeing same bean being created , destroyed , re-created when single user navigates between pages. checked access logs on tomcat server , shows user using compatible browser ie8 , not opening new tabs other navigating between pages. what lifecycle of window scoped bean. triggers window scope bean destroyed? this behavior not happen consistently on same browsers. happens users using ie8 while not others. of cases bean re-created seem cases user behind kind of proxy. proxy causing such behavior? again users session remains valid i.e. session keep tracks name of user etc., stays same between pages. how can behavior solved. window scope unreliable? yes, it's unreliable , perhaps doesn't serve purpose of window scoping. need implement own custom scope , not icefaces predefined #{window} . class org.icefaces.appl

How can I clean Eclipse installation? -

how handle old/corrupted plugins in eclipse? what ways clean current installation of eclipse? (juno, kepler) are there 3rd party software that? thanks. you can uninstall plugins have installed. can done using about eclipse -> installation details -> uninstall selected plugins

xml - Amazon API JSON Response -

i using amazon awsecommerceservice api getting info amazon site , use them page/site.i sending rest request , response getting in xml format. there way in response in json format.have googled lot unable find exact solution.rather looking xml json parsers looking inbuilt methods/parameters can give , response accordingly. rest url looks this: http://ecs.amazonaws.com/onca/xml?awsaccesskeyid=akiaid6rve3pnxnosvwa&associatetag=8329-3607-2382&itempage=1&keywords=famous&operation=itemsearch&responsegroup=salesrank&searchindex=books&service=awsecommerceservice&sort=salesrank&timestamp=2014-03-06t06%3a19%3a33z&version=2014-02-10&signature=m8ygf4numuganuuwi44dub80oxdmemugaunkzwemoys%3d. the above url wont work signature expired. getting response format of url when running in application. needs dying implement same last 2 days. there python module called boto3 using response comes in json format. more info see boto3 documnentation

− not getting reflected in html -

the minus sign not getting reflected in html file when dynamically pass java file − same when pass − gets decoded in html file. can how make &minus work? try using & '&' , - '-' refer documentation ascii html codes. might work.

c++ - Unhandled exception at std::length_error at memory location 0x002ff5dc -

im new in opencv code #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/highgui/highgui.hpp> #include <iostream> #include <fstream> #include <vector> #include <string> #include <complex> #include <cmath> #include <algorithm> #include "wavelet2d.h" #include "opencv/cv.h" #include "opencv/highgui.h" #include "opencv/cxcore.h" using namespace std; using namespace cv; void* maxval(vector<vector<double> > &arr, double &max){ max = 0; (unsigned int =0; < arr.size(); i++) { (unsigned int j =0; j < arr[0].size(); j++) { if (max <= arr[i][j]){ max = arr[i][j]; } } } return 0; } void* maxval1(vector<double> &arr, double &max){ max = 0; (unsigned int =0; < arr.size(); i++) { if (max <= arr[i]){ max = arr[i]; } } return

android Supporting Multiple Screens Calculation -

i had doubt i put 40px * 40 px images in drawable folder. and put 40px * 40 px images in drawable [hdpi] again . then tabhost set picture [hdpi] exists , not exist size 2 pictures displayed on screen not same , why? they same 40px * 40px why? different folder result in different calculation methods it? ps:[my phone pre-select [hdpi] folder] i think need create drawable folder in res folder , add images in drawable folder. in android there different resolutions screens , every resolution have fix limitation retrieving images on specific folders - hdpi, ldpi ,mdpi etc. when create drawable folder in res if different resolution screens occurred pic image drawable folder.

javascript - Loop on back button after re-direction with querystring -

the problem: i need start url query string containing url of second page - http://www.firsturl.com/?http://www.secondurl.com . on target page of first url, query string parsed extract second url , browser re-directed second url. done on $(document).ready it's automatic. works fine, of course falls in hole if user hits button on second url. here's basic code: $(document).ready(function() { var s = location.search; if(s != '') { var split = s.split('?'); var loc = split[1].replace('?', ''); location.href = '' + loc + ''; } else { //do else on target page.. } }); i've tried creating conditional case where, if referrer 2nd url ( loc in code above), re-direction doesn't execute, seems in case of re-direction, button doesn't return referrer. i have client side - have no access server. is there way prevent re-direction triggering on button click? thanks.

ruby on rails - undefined method `before_pdf_post_process' for Image:Class -

i using mongodb rails 4, beginner. getting "undefined method `before_pdf_post_process' image:class", when try upload pdf/text_files/videos . using "mongoid-paperclip" uploading. how include "processor code" in code. please me sort error @ earliest. thanks in advance. evidently op had different issue, top hit on google, , received same error message. me, solution found here: https://github.com/thoughtbot/paperclip/issues/1340 per issue-report: "you need put validation code after attachment declaration. these methods somehow not accessible, until 'has_attached_file' line." i moved validation line below "has_attached_file" section in model, , error went away.

javascript - Center Image ad content coming from Java script -

i using following html code load ad server, want display @ center, i'm using styles got internet nothing working. it displayed @ right corner , must responsive , @ center <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html> <head> <style type="text/css"> html, body { width:100%; height: 100%; margin: 0px; padding: 0px; // code got center content max-width: 100%; max-height: 100%; margin: auto; overflow: auto; position: fixed; margin-left: auto; margin-right: auto; } </style> </head> <body> <!-- script loads ad --> <script type='text/javascript'> var age = "23"; var gender="male"; //var location1="testifying"; var m3_u = (location.protocol=='https:'?'https://openxtest.wfihotsp

Linux IP adress cannot be accessed via ssh command -

in linux server have 2 interfaces linux server can accessed via terminal typing ssh username@ip1 or ssh username@ip2 every thing works fine until restarted server. access linux server via first ip address. checked ip configuration (here connected server via first ip address) nano etc/network/interfaces gives: iface eth0 inet static address 192.168.1.13 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.253 # dns-* options implemented resolvconf package, if installed dns-nameservers 192.168.1.2 # secondary network interface allow-hotplug eth1 iface eth1 inet static address 192.168.1.14 netmask 255.255.255.255 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.253 dns-nameservers 192.168.2.2 ifconfig shows eth0 so, once typed nano /sys/class/net/eth1/operstate i discovered interface(second ip adress) down tried ifconfig eth1 1

javascript - submit form on ENTER press int EXT js -

i new ext.js; need submit form when enter pressed below code dont know call in listener of password field here code: ie:what function call in listener <script type="text/javascript"> ext.onready(function() { ext.tip.quicktipmanager.init(); ext.create("ext.container.viewport", { layout: "border", rtl: <spring:theme code='theme.rtl' text='false' /> }); ext.create("ext.window.window", { title: "<spring:message code='title.login' text='login' />", height: 310, width: 450, closable: false, layout: "border", items: [{ xtype: "panel", border: false, bodycls: "login-header", height: 160, region: "north" }, { id: "<%=loginformid%>",

indexing - Is there any harm in creating a index that is a subset of unique clustered index? -

i have table abc , unique clustered index on below columns col1, col2, col4, col5, col6 it's vast table , analyzing of queries on table feel new index of below columns help. col1, col5, col2 but, not sure of performance impact , need know whether it;s idea create additional index. so, can have index has columns subset of unique clustered index (also order changed)? haven't found related while searching internet. hint's/thoughts helpful. as indexes computational used rapidly access data, can have several indexes overlaps without problems reading data. solution of index (col1, col5, col2) 1 index , (col1, col2, col4, col5, col6) usable , not deal performance issue reading data. of course, index comes cost when adding data (must write index), if table have big amount of write , have loss of time when writing data.

linux - Copy files to my usb ONLY in shell script -

i need write sh script copy files hard drive connected usb. connected usb same 1 , want make sure these non computer savvy people don't copy usb. script needs copied multiple linux computers can have different number of partitions or numer of usbs connected. data protection not important. my first thought: copy files "my usb flash drives name". way if usb name gets connected, data not copied it. how ? first, plug usb in , @ dmesg: $ dmesg and see like: [98937.147950] sd 15:0:0:0: [sdb] attached scsi removable disk then go /dev , gather uuid of pendrive: $ ls /dev/disk/by-uuid/ -l ... 98a9-d422 -> ../../sdb1 now can make script this: #!/bin/bash mkdir /mnt/my_pendrive mount /dev/disk/by-uuid/98a9-d422 /mnt/my_pendrive ... and work in every computer, uuid same anywhere plug pendrive in whenever want check whether precisely pendrive has been connected, check /dev/disk/by-uuid/ directory see if 98a9-d422 exists.

android - Extracting Sms in an xml file -

//checksms returning list sms private arraylist<sms> checksms() { uri urismsuri = uri.parse("content://sms/inbox"); cursor cur = getactivity().getcontentresolver().query(urismsuri, null, null, null, null); while (cur.movetonext()) { newsms.setsender(cur.getstring(cur.getcolumnindex("address"))); mylist.add(newsms); } createxml(); return (mylist); } //here createxml methode private void createxml() { file newxmlfile = new file(environment.getexternalstoragedirectory()+ "/smsfile.xml"); try {log.v(backupfragment.this.getclass().getname(), "create file:" + newxmlfile.createnewfile());} catch (ioexception e) {log.e("ioexception", "exception in createnewfile() method");} fileoutputstream fileos = null; try {fileos = new fileoutputstream(newxmlfile);} catch (filenotfoundexception e) {log.e("filenotfoundexception", "can't create fileoutputstream");} xmlserializer serializer = xml.new

ios - How to check if the app was already installed -

i have app want make update it. i have list of items in application, want add versions items, when item updated marked updated . or if add new item marked new . but new users install app first time items should new, , users have app on devices items should without mark intially. don't have user defaults in app can't check value. how can check if app installed on device? the answer you cannot know if didn't store information check if user updating app or installing scratch. you can use code know it, starting version implement in. bool versionupgraded; nsstring *version = [[[nsbundle mainbundle] infodictionary] objectforkey:@"cfbundleversion"]; nsstring *previousversion = [prefs stringforkey:@"appversion"]; if ([[nsuserdefaults standarduserdefaults] stringforkey:@"appversion"] != nil) { // see if version same previous one. if not, update. versionupgraded = !([previousversion isequaltostring: version]); } // no &

update after delete row in ruby on rails -

two models have created i.e "user" , "communication", , schema below: user model scheme: id | name | email | skilltype | user_need 1 | ijk | ijk@ijk.com | mentor | ap chinese 2 | mno | mno@mno.com | protege | ap biology communication model schema: id | userid | communicationmode | communicationdetail 1 | 1 | phone | 1234567890 2 | 1 | email | ijk@ijk.com in user model have has_many relation communication, , in communication model have belongs_to :user adding communication preferences when user sign ups application, , in setting, trying display user's communication preferences in separate controls.when user submits settings page, want delete each record in communication related current_user, working fine , code below communication.delete_all(:userid => current_user.id) but when update them new action in controller, records not updating communication. , below "new" action c

How to break down tuple from Python to PHP -

i'm using http post request codeigniter python , return tuple mysql python codeigniter controller: $data['email'] = $this->input->post("email"); $url = 'http://domain/path'; $data = array('email' => $data['email']); // use key 'http' if send request https://... $options = array( 'http' => array( 'header' => "content-type: application/x-www-form-urlencoded\r\n", 'method' => 'post', 'content' => http_build_query($data), ), ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); var_dump($result); python code: elif self.path=="/forgotpass": print "forgot password module" form = cgi.fieldstorage( fp=self.rfile, headers=self.headers, environ={'request_method':'post', 'content_type':self.headers[&#

prolog - How to loop through a list to create a specific other list -

i need define predicate parses given list looks following: change([10,-,6], list). //send list = [item(num, 10), item(minus, _), item(num, 6)] //returns this. i have no idea how check if item in list 'num', or if minus or what... change([], _). change([h|rest], list) :- "do atom here?" , transform(rest, [item(atom, h) | list] ). what might like? since you're applying transformation on each list' element, change/2 should be change([], []). change([h|rest], [q|list]) :- qualify(h,q) change(rest, list]). and qualify(n, item(num, n)) :- number(n), !. qualify(-, item(minus, _)) :- !. qualify(a, item(atom, a)). % left unspecified, assume else atom... the change/2 it's maplist, , written as: change(i, o) :- maplist(qualify, i, o).

forth - Obtaining a Factor binary... still possible with the Factorcode.org website down? -

update (12-mar-2014): all sites back: factorcode, planet-factor, builds.factorcode, , concatenative. downloads back. looks sites moved different host (rackspace?) , quite revamped. (this can question can considered closed.) i've been trying recent windows binary of factor programming language , has been confounded fact factorcode.org website appears down. unfortunately, download links seem point it, builds.factorcode.org . i don't know how long it's been way, seems not first time... looks it's been down since start of march , , there's noise in october , , again in december . as factor open-source, hoping binaries might mirrored somewhere else. used on sourceforge appears have been removed factorcode.org , , main github repository factor seems hosted on factorcode.org . how obtain binaries? there perhaps way? (p.s.: these related sites down: concatenative.org , planet factor .) i have used forth fair amount , have been hearing more f

C# mysql parameterized query -

i have peace of code need retrieve data mysql . if use parameterized query not take actual parameter value instead takes parameter name value. error: @choise must defined mysqlconnection connection = new mysqlconnection(""); mysqldataadapter mysqldataadapter; dataset ds; private string columnvalue = xxx; private string choise = yyy; mysqlcommand command = connection.createcommand(); command.commandtext = "select * table2 " + columnvalue + " = @choise"; command.parameters.add(new mysqlparameter("@choise", choise)); ds = new dataset(); connection.open(); mysqldataadapter = new mysqldataadapter(command.commandtext, connection); mysqldataadapter.fill(ds); connection.close(); when run query like: select * table2 xxx = @choise instead of select * table2 xxx = yyy . problem? i have tried: command.parameters.add(new mysqlparameter("@choise", choise)); command.parameters.addwithvalue("@choise", choise); it wor

linux - Bluetooth mouse with lag - poor RSSI -

some days ago start use bt mouse. work fine , other times have lag. after try check causes this, , ran several monitoring tools , notice if rssi 0 works fine... when decreases, lag got worst, , lower rssi value, worst lag. because work in office lots of wireless equipment, adaptive frequency hooping non clean environment, or frequency hooping not working should, , not changing cleaner frequency. it possible, in linux, connection mouse stuck specific channel/frequency when manually found 1 clener? there tool can channel/frequency connection using? regards, filipe

iphone - PhoneGap disable iPad support -

i have iphone support application. as far can see phonegap documentation , 1 can set handset option in target-device : <preference name="target-device" value="handset" /> but not work. after build (i build application locally on machine), see devices set universal in deployment info of project. how disable ipad support? this functionality added in cordova-lib-0.21.8-dev according https://issues.apache.org/jira/browse/cb-7118 has been resolved. i've tested cordova 4.2.0 , appears working correctly.

json - How to pass php variable inside json_decode function -

see below code : trying pass variable called $search_term inside json_decode function not working. need do? $search_term = $this->input->post('search'); //echo $search_term; die(); $jsonarray = json_decode(file_get_contents('http://www.bloomapi.com/api/search?limit=10&offset=0&key1=practice_address.zip&op1=eq&value1='.$search_term),true); print_r($jsonarray); i check it's correct change post method can test quickly. it's working fine work post value also. $search_term = $this->input->get('search'); $jsonarray = json_decode(file_get_contents('http://www.bloomapi.com/api/search?limit=10&offset=0&key1=practice_address.zip&op1=eq&value1=' . $search_term), true); print_r($jsonarray); you recheck $search_term = $this->input->post('search'); other wise follow bellow instruction proper debuging $search_term = $this->input->post('

c# - Execution of 'System.Linq.Enumerable:GroupBy(IEnumerable`1,Func`2)' on the database server side currently not implemented -

i getting error 'execution of 'system.linq.enumerable:groupby(ienumerable`1,func`2)' on database server side not implemented.' when execute following query from t in dbcontext.trackerrecords t.deviceserial.value.equals(deviceserial) && t.date.value >= fromdate && t.date.value <= todate orderby t.date.value descending group t t.date.value.date g select new tripdatamodel { day = g.key, trips = (from x in g group x x.date.value.hour gj gj.max(m => m.speed.value) > 0 let avgspd = gj.average(m => m.speed.value) select new tripmodel { minspeed = gj.min(m => m.speed.value), maxspeed = gj.max(m => m.speed.value), avgspeed = avgspd > 0 ? math.round(avgspd, 2, midpointrounding.awayfromzero) : 0, fromhour = new datetime(g.key.year, g.key.month, g.key.day, gj.key, 0, 0) }) } i tried query in linqtosql

php - The in_array doesn't compare my converted objects as it is supposed to -

i'm developping website, if user changes data, should stored on background, see did last change , etc... . have 1 object called event, data onscreen devided 2 tabs (client , event). after submit, fields , put data in object. have self made function compare values in new boject values of old object: function createarrayreturndiff($obj1, $obj2) { $helparray1 = (array) $obj1; //convert object array $helparray2 = (array) $obj2; //convert object array $help = array_diff_assoc($helparray2, $helparray1); //computes difference of arrays additional index check return $help; } now works fine, array returned names of field , new value. here comes tricky part. after return of array, loop trough want check tab value on in order give beter user feedback later. if value on cleint or event tab. made 2 arrays describe fields in each tab. $tabklant = array('evenementfirmanaam', 'evenementaanspreking', 'evenementcontactpersoon', 'evenementcontactpersoonstraa

javascript - Scripts gets interpreted as Stylesheet but transferred with MIME type text/html -

i'm getting 2 console warnings in chrome: resource interpreted stylesheet transferred mime type text/html: "http://domain/". domain/:11 resource interpreted stylesheet transferred mime type text/html: "http://domain/". domain/:11 on line 11, have: <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> here's of code head section: <head> <meta charset="utf-8"> <title>laoautod</title> <meta http-equiv = "content-type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="css/base.css"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> <script type="text/javascript" src="js/center.js"></script> <script type=&q

json - Android JSONObject skipping null value while creating -

i want send jsonobject mobile server in android . there null values want send. i have tried following both way skipping null values. tempjsonvaluesorder.put(databasehelper.order_others, ordercursor.isnull(ordercursor.getcolumnindex(databasehelper.order_others)) ? null :ordercursor.getstring(ordercursor.getcolumnindex(databasehelper.order_others))); is there way put null value in jsonobject ? help appreciated. after found solution like: tempjsonvaluesorder.put(databasehelper.order_transport, ordercursor.isnull(ordercursor.getcolumnindex(databasehelper.order_transport)) ? "" :ordercursor.getstring(ordercursor.getcolumnindex(databasehelper.order_transport)));

javascript - How to redirect to another jsp page without loading the current page? -

i using script runs in onload event. template.html in html file, headers, footers , iframe elements used. <script> function callbeforeload() { if(condition) { //success } else { window.location("exception.jsp"); } } </script> <body onload="callbeforeload();"> if use window.location, redirecting jsp page. question template.html should not load entire page. should first check script , proceed other function. loads entire page (normally iframe in case) , comes script. there alternate way achieve this? try writing script tag first element in head tag. not wrap code inside function directly executed. <head> <script> if(condition) { //success } else { window.location("exception.jsp"); } </script>

makefile - why I make the android source cant't run in the nexus4 -

my phone nexsu4. , version 4.4.2 i source google server. source build/envsetup.sh lunch aosp_maguro make -j4 then copy wpa_supplicant nexus4 , reboot phone. but wlan can't run. who can me? thx! maguro galaxy nexus, not nexus 4. if building nexus 4, need mako proprietary drivers google's proprietary binaries . use lunch aosp_mako-userdebug to select mako device.

php - Trying to stop regex at a tag -

i know there other posts similar name i've looked through them , haven't helped me resolve this. i'm trying head around regex , preg_match. going through body of text , each time link exists want extracted. i'm using following: $reg_exurl = "/(http|https|ftp|ftps)\:\/\/[a-za-z0-9\-\.]+\.[a-za-z]{2,3}(\/\s*)?/"; which works fine until finds 1 has <br after it. url plus <br means doesn't work correctly. how can have stops @ < without including it? also, have been looking everywhere clear explanation of using regex , i'm still confused it. has guides on future reference? \s* broad. in particular, inject code url like: http://hax.hax/"><script>alert('haaaaaaax!');</script> you should allow characters allowed in urls: [-a-za-z0-9._~:/?#[]@!$&'()*+,;=]* some of these characters allowed in specific places (such ? ) if want better validation need more cleverness

.htaccess - How to force http post wildcard redirects -

i have large number of pages force http instead of https code have is: rewriteengine on rewritecond %{https} =on rewriterule ^$ http://mydomain.com [r=301,l] how add wildcard redirect this? maybe rewriterule ^$ http://mydomain.com/category/* [r=301,l] it's on wordpress site if makes difference? cheers rewriteengine on rewritecond %{https} =on rewriterule (.*) http://%{http_host}/$1 [r=301,l,qsa] this redirect https://hostname/* http://hostname/*

c++ - Connect: No such Slot QTreeView -

i have inherited class maintree qtreeview maintree.cpp file void maintree::launchtree() { //tree launching connect(this, signal(customcontextmenurequested(const qpoint& )),this,slot(showcustomcontextmenu(const qpoint&))); } void maintree::showcustomcontextmenu(const qpoint &pos) { //add actions } but following error qobject::connect: no such slot qtreeview::showcustomcontextmenu(const qpoint&) i not understand why, missing ?? definition of class maintree class maintree : public qtreeview { public: maintree(); maintree(qwidget *parent = 0); public slots: private slots: void showcustomcontextmenu(const qpoint& pos); private: void launchtree(); }; you missing q_object macro out, try this: class maintree : public qtreeview { q_object // ^^^^^ public: maintree(); maintree(qwidget *parent = 0); public slots: private slots: void showcustomcontextmenu(const qpoint& pos); private: void laun

java - Alternative of ABS() in Mysql for JPA -

i have table like:- +----+-------+ | id | score | +----+-------+ | 3 | -10 | | 2 | -11 | | 4 | -9 | | 5 | 1 | | 1 | 12 | +----+-------+ and expecting output +----+-------+ | id | score | +----+-------+ | 1 | 12 | | 2 | -11 | | 3 | -10 | | 4 | -9 | | 5 | 1 | +----+-------+ although have query select * table order abs(score) desc; want replacement of jpql/jpa. query query=em.createquery("select p product p abs(p.price)<50.0"); got source

Need regx for converting all the double backslash to single backslash in perl -

i have string below string using regular expression nothing working: use strict; use warnings; $var ="\\\\abc\\cde\\pqs\\some"; $var1 = s/\\/\/; $var =~ s/$var/$var1/; print "$var\n"; purpose double backslash need change single backslash. #!/usr/bin/perl -w use strict; use warnings; $var ="\\\\abc\\cde\\pqs\\some"; $var =~ s|\\{2}|\\|g; print "$var\n";

Access 2013: Is it possible to color single lines in Datasheet or Listview? -

i've searched hours found "conditional formatting". conditional formatting seems not work in form, subform or listview, in report managed that. i want simple: color specific rows in list on form. can't difficult... somehow is. thanks help!

yii - Customizing bootstrap.widgets.TbMenu -

i'm using yii booster , i'm trying make list this, same id's , class's <div id="sidebar-nav"> <ul id="dashboard-menu"> <li class="active"> <div class="pointer"> <div class="arrow"></div> <div class="arrow_border"></div> </div> <a href="index.html"> <i class="icon-home"></i> <span>home</span> </a> </li> <li> <a href="chart-showcase.html"> <i class="icon-signal"></i> <span>charts</span> </a> </li> <li> <a class

ios - TestFlight does not accept builds with TestFlight SDK -

trying upload build tf sdk see following error message: sorry, no longer accepting new builds use testflight sdk. please, remove sdk , re-upload. does know information this? how long that? fixed? doing wrong? interesting, in tf team ok , upload sdk goes success. testflight acquired apple. android has been disabled testflight. see news here . don't worry it. use mobile beta testing like 1) ubertesters 2) hockeyapp 3) mobtest 4) centercode 5) appmuse

asp.net - how to upload multiple images using single fileuploader button in 4.0 -

hi coder have fileupload button used insert images system , save them database want select multiple images using single file uploader in framework 4.0 each images has priority well code: protected void btnsubmit_click(object sender, eventargs e) { try { boolean enable = true; string relativepath = "https://images/module/" + ddlppt.selectedvalue + "/"; //get imagename fileupload control string imgname = fileuploadimages.filename.tostring(); //sets image path if exist store image in place else create new 1 string imgpath = "images/modules/" + "" + ddlppt.selectedvalue + "/"; bool isexists = system.io.directory.exists(server.mappath(imgpath)); if (!isexists) system.io.directory.createdirectory(server.mappath(imgpath)); //then save folder fileuploadimages.saveas(server.mappath(imgpath + imgname)

javascript - Implement polygon tool on HTML5 canvas -

i trying imitate polygon tool in paint allow user draw same on canvas. below have coded far how not exact same paint tool. know there way fill shape once it's drawn. can please help. var startpointx = "", startpointy = "", endpointx, endpointy, isnewshape = false; function tool_polygon() { var tool = this; this.started = false; this.mousedown = function (ev) { tool.started = true; tool.x0 = ev.offsetx; tool.y0 = ev.offsety; console.log('mousedown'); if (startpointx == "" && startpointy == "") { startpointx = tool.x0; startpointy = tool.y0; } console.log('startpointx ' + startpointx + ' startpointy ' + startpointy + ' ev.offsetx ' + ev.offsetx + ' ev.offsety ' + ev.offsety + ' isnewshape ' + isnewshape); //if ((math.abs(startpointx - ev.offsetx) < 5) && (math.abs(startpointy - ev.offsety) < 5) && (startpoi

c# - How to get specific data from a website? -

i want download products website http://fashiondropshippers.com/ excel file.i wanted sell products on website. how can grab products name,picture,description,price? comfortable using .net languages. can me please? ask them if have api that's best way go. if don't, use rss feeds. have @ rss feeds page: http://fashiondropshippers.com/rss/ . click on feed link of category , notice nice list of products photos , prices. can develop app consume rss feeds want.

php - Wordpress remove 'www' from image url -

i have website developed wordpress , i'm facing issue image not co-ordinate url. the image url should ... http://domainname.com/wp-content/uploads/2012/09/handshake-cropped-300x2651.png but getting "www" ie : http://www.domainname.com/wp-content/uploads/2012/09/handshake-cropped-300x2651.png so reason image not loading site, checked in media library image url... what reason issue? , how can fixed this. have changes upload path url , site url :( rewriteengine on rewritecond %{http_host} ^www\.(.*)$ [nc] rewriterule ^(.*)$ http://%1%{request_uri} [r=301,qsa,nc,l] or # force non-www domain rewritecond %{http_host} ^www\.example\.com$ [nc] rewriterule (.*) http://example.com/$1 [r=301,l]

c# - How do I connect to a USB webcam in .NET? -

i want connect usb webcam in .net, using c#. being new .net don't know kind of support there in standard libraries doing so. found 1 example on web copies bitmaps through clipboard, seems hacky (and slow). there better way? you need use windows image acquisition (wia) integrate webcam application. there plenty examples of readily available. here c# webcam user control source. here more articles , blog posts people looking solve same problem are: msdn coding4fun: @ me! windows image acquisition codeproject: wia scripting , .net codeproject: webcam fast image capture service using wia clausn.dk: webcam control c# , wia

c - Multithreading in Windows - Error in creating array of function pointers -

i beginner in multithreading(windows). want create 2 threads using createthread function in loop. 2 threads functions want spawn different. creating array of function pointers store 2 functions want spawn. use array values in lpstartaddress parameter of create thread function. getting error in creating array of function pointers. have post significant part of code below. please correct mistake , me create array of function pointers (whose functions going spawned threads). in advance. dword winapi threadproc1(lpvoid lparam) { print_func(getcurrentthreadid(),(lpdword)lparam); return 1; } dword winapi threadproc2(lpvoid lparam) { print_func(getcurrentthreadid(),(lpdword)lparam); return 1; } int main() { handle hthread[max_threads] = {null};//max_threads=2 dword dwthreadid; /* array of lparam */ dword dwarrayparam[param_max] = {1,2};//param_max=2 /* array of function ptrs */ typedef dword winapi (*t_threadproc)(lpvoid);//error in li

java - I look for an explanation of libgdx's asset manager -

i create asset-manager. know asset-manager "libgdx" don't wanna use libgdx because programming studying purposes. wanna understand entire program , write scratch. now need asset-manager because ran out of memory. took @ asset-manager of libgdx pretty code , don't understood completly. i know basic principle/idea of libgdx's asset-manager. know works hashmaps , in own thread asyncron. pretty know. could me? there isn't more know, other it's using maps store , retrieve assets. basically have this: class assetmanager { private map<string, object> assets = new hashmap<string, object>(); public void storeasset(string key, object asset) { assets.put(key, asset); } public <t> t getasset(string key, class<t> clazz) { return (t) assets.get(key); } public void freeasset(string key) { assets.remove(key); } } that generic getter optional, casts yourself, it's m

typo3 - TypoScript: mixed menu of public and access restricted pages -

i want make menu containing both public , access restricted pages, based on following requirements: public pages should linked, regardless whether user logged in or not access restricted pages should not linked if user not logged in access restricted pages should linked if user logged in this have far: lib.menu = hmenu lib.menu.1 = tmenu lib.menu.1 { // satisfies requirement 2 no.donotlinkit = 1 // satisfies requirement 3 usr = 1 } however, expect, requirement 1 isn't satisfied way. can't come way make lib.menu.1.no conditional based on page being public or access restricted. if set no.donotlinkit = 1 normal pages not linked. want set showaccessrestrictedpages = <uid> uid id if page login form. see documentation. can set cur.donotlinkit = 1 , requirement 2.

java - JPA2/Hibernate generated delete-statement missing a column -

using: spring, jpa2.0, hibernate, crudrepository so heres relevant mapping-xml-parts.. article-entity: <entity class="net.combase.cloud.data.pojo.articlepojo" metadata-complete="true" > <attributes> ///stuff following <element-collection name="prices" target-class="net.combase.cloud.data.pojo.pricepojo" fetch="lazy" > <collection-table> <join-column name="article_pojo" referenced-column-name="id" unique="false" /> </collection-table> </element-collection> </attributes> </entity> price-embeddable <embeddable class="net.combase.cloud.data.pojo.pricepojo" metadata-complete="true" access="property" > <attributes> <basic name="validfrom" optional="false"><temporal>timestamp</temporal></b

ajax - Conflict when pagination between clientRows and rows -

i have developed extendeddatamodel supports pagination on server side (by querying db). works expected, pagination occurs , works fine. but, @ same time, want load data of each page in client side ajax, set clientrows property extendeddatatable, , not rows attribute divides each logical page. in general, want able set clientrows < rows, pagination + ajax loading in each page. but, @ moment works when set clientrows=rows isn´t need. what happening right if set clientrows attribute, walk method recieves range goes clientrows rows, , ignores row attribute completely. if dont set clientrows, row attribute passed (ok!) range limit (totalrows). don´t know if helps. i post relevant code below. the paginationdatamodel follows: public abstract class paginationdatamodel<t> extends extendeddatamodel<t> { private sequencerange cachedrange; private integer cachedrowcount; private list<t> cachedlist; private object rowkey; /** * * @param firstrow * @param numro

c++ - Databse getting locked when trying to update and insert -

when try insert or update, database gets locked randomly. giving code using. kindly let me know if else needs done apart this. i read issue occurs because of open , close functionality of database. please let me know issue is? -(bool)createdb : (const char *)str { nsstring *docsdir; nsarray *dirpaths; // documents directory dirpaths = nssearchpathfordirectoriesindomains (nsdocumentdirectory, nsuserdomainmask, yes); docsdir = dirpaths[0]; // build path database file databasepath = [[nsstring alloc] initwithstring:[docsdir stringbyappendingpathcomponent: @"spotlogic.db"]]; bool issuccess = yes; // nsfilemanager *filemgr = [nsfilemanager defaultmanager]; dbpath = [databasepath utf8string]; if (sqlite3_open(dbpath, &database) == sqlite_ok) { char *errmsg; const char *sql_stmt = str; if (sqlite3_exec(database, sql_stmt, null, null, &errmsg) != sqlite_ok) { issuccess = no; nslog(@"f

android - How to add an item multiple times in a ListViewActivity from another ListViewActivity -

this original listview class select item list want select same item 4 times, in activity should add item 4 times. can add 1 time in activity. have used sharedpreferences adding. can me how can store value 4 times?any tips appreciated :((( thanks //this class select item public class alcohol extends activity { private list<alcohols> alcohol = new arraylist<alcohols>(); string wine; string beer; sharedpreferences somedata; public static string filename = "mysharedstring"; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_alcohol); somedata = getsharedpreferences(filename, 0); alcohollist(); alcohollistview(); registerclickcallback(); } private void registerclickcallback() { // todo auto-generated method stub listview list = (listview) findviewbyid(r.id.alcohollistview); list.setonitemclicklistener(new adapterview.onitemclicklistener() {

c# - creating a new folder with todays date on specific folder -

i trying create new folder todays date on specific given path: string localdirectory = directory.createdirectory( datetime.now.tostring("i:\\test\\final test\\snaps\\dd-mm-yyyy")); but receive error: cannot implicitly convert type 'system.io.directoryinfo' 'string' as per the documentation directory.createdirectory , createdirectory returns directoryinfo object, not string. so this: directoryinfo localdirectory = directory.createdirectory(... or this: var localdirectory = directory.createdirectory(... (which same thing)

html - Looping through MySQL select data with PHP if statements -

i'm trying return results database , output html. if feature=1 want image associated product display. underneath this, want title of results display regardless of value of feature. grouped release_date in variable $group_date . the code i've supplied @ bottom allows me retrieve data (i think down looping through 1 row , outputting before going on next, i'm not sure solution is): group_date ----- ----- ----- |img| |img| |img| title ----- title ----- title ----- title group_date 2 ----- ----- ----- |img| |img| |img| title ----- title ----- title ----- title title i results displayed this group_date ----- ----- ----- |img| |img| |img| ----- ----- ----- title 1 title 2 title 3 title 4 group_date 2 ----- ----- ----- |img| |img| |img| ----- ----- ----- title 1 title 2 title 3 title 4 title 5 ..