Posts

Showing posts from May, 2014

android - How to execute a method for each item in a listview -

i have arrayadapter<myservice> , each item in listview have 1 button executes async call download file http request, working pretty well. now, created button "download all" in activity, button execute items in listview , have no idea how that. should iterate through list, button view , call click? i have suggestions. i don't think iterating , faking click idea. implement separate procedure "all" button takes data backing adapter (in case it's array, right) , executes logic download 1 one or (much more preferrable imo) in batch, example send file ids list server , make server return zip.

SQL Server Query -- How to continue on error -

i have table containing thousands of fields , of them duplicated due customer's failure , need fix it. can find them , delete them row row, looking faster work around. as of these related other tables, can not deleted directly without taking care of relation. wand first delete not included in relationship running simple delete command without conditions, unrelated rows deleted , rest of them can done rapidly. here question, can skip errors , delete unrelated rows? when run query, stops when first related id found.(the conflict occurred in database ....) any suggestions? you use outer join deletion (where related table other side of join), id null in outer join, it's safe delete won't constraint violation. however, huge, unbounded deletions sounds massive risk me, ensure have backups.

powershell - COM+ Application Set UP new service -

i have com plus application of activation type 1, i.e server type application. , identity network service.now need set following properties application. activation->run nt service->setup new service->select dependencies how can programmatically through powershell? searched lot on web not find property through can set these up.

How to read vibration setting android? -

is possible read vibration setting ringing? i'm getting vibration state using: if(audiomanager.getringermode() == audiomanager.ringer_mode_silent) { //silent } else if(audiomanager.getringermode() == audiomanager.ringer_mode_vibrate) { ringphone(callerring); vibrator = (vibrator) getsystemservice(context.vibrator_service); long[] pattern = { 0, 1000, 1000 }; vibrator.vibrate(pattern, 0); } else if(audiomanager.getringermode() == audiomanager.ringer_mode_normal) { ringphone(callerring); } in case of ringer_mode_normal , want setting vibration on incoming call. in android system settings, there option inside sound, "vibrate on ring". need read option inability. any appreciated. thanks a little late, need same , solve by: public static boolean checkvibreationison(context context) { return (1 == settings.system.getint(context.getcontentresolver(), "vibrate_when_

node.js - How to change the order of the fields in JSON -

scenario : consider have json documents follows: { "name": "david", "age" : 78, "noofvisits" : 4 } issues: wanted change sequence/order of fields in document, want age , noofvisits & lastly name . as of storing value in temporary variable, deleting field & recreating same field. since reassignment did not work :( i did in following way: temp = doc["age"]; delete doc['age']; doc["age"] = temp; temp = doc["noofvisits "]; delete doc['noofvisits ']; doc["noofvisits"] = temp; temp = doc["name"]; delete doc['name']; doc["name"] = temp; so desired ordered json document. requirement peculiar kind still want efficient solution question : can out efficient way achieve same? may change using json.stringify() do like var json = { "name": "david", &q

c# - How to replace " " " with space -

i trying replace double quotes space it's not working, says syntax error, "'asd"asd', 'asdasda"sdsa'" // string pattern getting "somehow" string b = a.replace(""", " ")); you have escape " backslash: string b = a.replace("\"", " "); where string a bla bla " bla " bla bla

Is it possible to test Responsive Web Design application with Sahi? -

i'm testing responsive web design application now. i'm doing manual testing on firefox, chrome , ie using web developer tool. i automate testing. possible automate responsive web design sahi? if dont need visual confirmation, can test phantomjs. have @ http://sahi.co.in/w/sahi-headless-execution-with-phantomjs , add line "page.viewportsize = { width: 1000, height: 1000 };" sahi.js execute phantomjs. can set width , height value want. improve this, create different phantomjs scripts different viewport sizes , add multiple phantomjs launcher in browsers.xml. phantomjsmobile, phantomjstablet ... if need see results, not test functionality, taking screenshots phantomjs possible. https://github.com/ariya/phantomjs/wiki/screen-capture

What library should I use to load a http url and get the html string out of it in OCaml? -

my purpose simple. i have url. web page. want download string. string html content, in utf-8 encoding. what library should use? try http_client.convenience.http_get ocamlnet.

objective c - Insert UNICODE HAIRSPACE character into NSString -

Image
i'm trying add unicode character nsstring in ways: nsstring *euformatted = [nsstring stringwithformat:@"\u200a%@",self.eu]; or unichar hairspacechar = 0x200a; // hairspace symbol nsstring* hairspace = [[nsstring alloc] initwithcharacters:&hairspacechar length:1]; nsstring *euformatted = [nsstring stringwithformat:@"%@%@",hairspace,self.eu]; but not results ... try find solution making me crazy since 3 days. i have try set font of uilabel show string that: bigfont = [uifont fontwithname:@"helvetica" size:10.0f]; but no way, hairspace not supported. here screenshot if see, hairspace suppose after number 10 , before '°' character. if try nslog(@"%@", [nsstring stringwithformat:@"-\u200a-"]); i '- -'. second example not work.

Actionscript 4: NetConnection.connect(...) does not fire a NetStatusEvent event -

i downloaded red5-recorder ( http://www.red5-recorder.com/ ) , fails allow me start recording. after debugging found netconnection, needed record media server, created not fire netstatusevent event, fails silently. have implemented connection following minimal working example: trace("make net connection"); nc = new netconnection(); nc.client = { onbwdone: function():void{ trace("bandwidth check done.") } }; trace("add event listener"); nc.addeventlistener(netstatusevent.net_status, function(event:netstatusevent) { trace("handle"); }); trace("connect!"); nc.connect("rtmp://localshost/oflademo/test/"); trace("connect done"); the output of piece of code is: make net connection add event listener connect! connect done the actionscript api states connect-call fires such event: http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/flash/net/netconnection.html#includeexamplessummary moreov

objective c - Not able to extract a zipped file larger than 4 gb using zip archive ios -

i using ziparchive sdk unzip files. unzipopenfile call fails on files larger 4gb. please help. i ran same problem , trying solve on couple of days. finally, solved it. with instruction can unzip big files (even 8gb) in ios without problems. this step-by-step instruction how solve it: 1) download objective-zip https://github.com/flyingdolphinstudio/objective-zip 2) download minizip https://github.com/nmoinvaz/minizip 3) take 4 files - ioapi.c, ioapi.h, unzip.c, unzip.h - minizip folder (which downloaded in step 2) , paste objective-zip/minizip folder (override files). 4) go objective-zip/objective-zip/zipfile.m , replace string int err= unzlocatefile(_unzfile, [filenameinzip cstringusingencoding:nsutf8stringencoding], 1); to this int err= unzlocatefile(_unzfile, [filenameinzip cstringusingencoding:nsutf8stringencoding], (unzfilenamecomparer)1); 5) finally, add objective-zip project , happy unzipping! :) now can unzip big files in ios. checked on 8gb-z

javascript - How to change style of HTML element depending on another elements style? -

in web application changing style of html element using javascript. see below code, function layout() { if(document.getelementbyid('sh1').getattribute('src') == "abc.png") { document.getelementbyid("sh1").style.display="none"; } else { document.getelementbyid("sh1").style.display="block"; } } and html : <img id="sh1" src="abc.png" /> now want if img elements style display:none; below elements <p id="text1">name<br />description</p> style should changed display:none; , if img elements style display:block; above elements style should changed display:block; automatically. how can achieved? add other element in function too. this: function layout(){ if(document.getelementbyid('sh1').getattribute('src') == "abc.png"){ document.getelementbyid("sh1").style.display="

powershell - Test Automation tool not running via Windows Task Scheduler -

here general description of issue cannot solve: we have windowsserver 2008 r2 system used running install of our product(using powershell script), , powershell script calls .exe of our ui test automation tool (ranorex). the install of product works fine, ui automation portion runs if physically logged in via remote desktop. if remote desktop session closed (but programs continue run..so user technically logged in), ui automation portion not run. the options selected on general tab of job are: -run when user logged in; -run highest privileges; any ideas on has had issue , got work extremly helpful. thanks, eric ui operations in suspended state when user disconnected rdp session. use tool vnc or equivalent have access main console these ui operations remain active.

c++ - How to define `health` and `maxHealth` in one object, when `healt` can't be higher than `maxHealth`? -

i have class called warrior has uint m_health , uint m_maxhealth attributes. want constructor take parameters warrior(uint health, uint maxhealth) . now i've studied c++ lot , know syntax etc, it's hard find tutorials on how use stuff etc. don't know how should define health , maxhealth when health can't higher maxhealth :/ here few methods thought of: // method 1 warrior::warrior(uint health, uint maxhealth) : m_health((health > maxhealth) ? maxhealth : health), m_maxhealth(maxhealth) {} // method 2 warrior::warrior(uint health, uint maxhealth) : m_maxhealth(maxhealth) { if (health > maxhealth) { m_health = maxhealth; } else { m_health = health; } } i'm sure there other ways too. sorry if opinion question, if there's "preferred" way in c++, be? i put assertion or throw exception in case precondition not met: warrior::warrior(uint health, uint maxhealth) : m_health(hea

persistence - Mule: after delivering a message, save the current timestamp for later use. What's the correct idiom? -

i'm connecting third-party web service retrieve rows underlying database. can optionally pass parameter this: http://server.com/resource?createdafter=[yyyy-mm-dd hh:ss] to rows created after given date. this means have store current timestamp (using #[function:datestamp:...], no problem) in 1 message scope , retrieve in another. it implies timestamp should preserved in case of outage. obviously, use subflow containing file endpoint, saving in designated file on path. but, intuitively, based on (very!) limited experience, feels hackish. what's correct idiom solve this? thanks! the object store module designed that: allow save bits of information flows. see: http://mulesoft.github.io/mule-module-objectstore/mule/objectstore-config.html https://github.com/mulesoft/mule-module-objectstore/

How to add html tags in a php -

i'm new php. not know how use expressions. here php code search file of site. want add html tags such href, div, li, ul, etc. how it? if(mysqli_num_rows($results) >= 1) { $output = ""; while($row = mysqli_fetch_array($results)) { $output .= "size: " . $row['fh_vsize']. "<br />"; $output .= "icon: <img src=" . $path .$row['fh_sicon']. " alt=><br />"; $output .= "file id: " . str_replace("_"," ",$row['fh_sid']) . ""; $nbsp; $nbsp; $output .= "" . $row['fh_vcaption'] . "<br />"; $output .= "description: " . substr(strip_tags($row['fh_sdescription']),0,150) . "<br />"; $output .= "download: <a href=download_" . $row['fh_sid'] . "/>download</a><br /><br />"; } echo $ou

rad - How to open another page in HTML5 Builder Server Mobile Application -

we still rookie developers in html5 builder, creating server mobile application. we know how open page (page2.php) using javascript. basically, user fill in form, when 'submit' button clicked, few basic checks done in javascript (like check if fields filled in) , if validation successful, app needs load next page. the following code have been tried: window.location = "page2.php"; window.open('page2.php','_parent'); both of these work fine when app running in browser on pc, not work on deployed app on android, end product. tested on more 1 device different versions of android, same result. any appreciated, thank you. if using client-side ajax navigation, enabled default in mobile pages, can change page this: $.mobile.changepage("targetpage.php");

ruby on rails - nginx reverse proxy setup resulting in strange access-control-allow-origin issue -

i have rails application setup on nginx/passenger on ubuntu. added faye running on thin requires adding reverse proxy server setup in nginx config. managed work setup strange: works if access server www.mydomain.com , access reverse proxy using javascript code @ mydomain.com/faye. although manage access faye server way, chrome browser console repeatedly flashes access-control-allow-origin error, know not long-term solution. error makes sense me couldn't fix after many tries. xmlhttprequest cannot load mydomain.com/faye. origin www.mydomain.com not allowed access-control-allow-origin. the obvious solution access www.mydomain.com , www.mydomain.com/faye, doing results in 502 gateway error. if strip both www's 502 error. i tried rewrite www.mydomain.com mydomain.com in nginx , access mydomain.com, still doesn't work. below abridged nginx.conf. assistance appreciated! http { passenger_root <path_to_passenger_root> passenger_ruby <path_to_passenger_rub

qTip2 jquery with asp.net textbox -

how can implement jquery plugin qtip2 http://craigsworks.com/projects/qtip2/ asp.net textbox? (elegant tooltip on mouseover) <script type="text/javascript" src="../chosen/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="../chosen/jquery.qtip-1.0.0-rc3.min.js"></script> <script> $('tbloginname').qtip({ content: 'this active list element', show: 'mouseover', hide: 'mouseout' }) </script> <asp:textbox cssclass="textbox" id="tbloginname" name="tbloginname" runat="server"/> here code, isn't working. wrong? regards you should wait document ready: $(function () { //shorthand $(document).ready(function(){...}); $('tbloginname').qtip({ content: 'this active list element', show: 'mouseover', hide: 'mouseout'

image processing - imhist return error with bmp data in matlab -

i have image , want calculate historgram of it,but code return error , i=imread('image number one.bmp'); imhist(i); and error ??? error using ==> iptcheckinput function imhist expected first input, or x, two-dimensional. error in ==> imhist>parse_inputs @ 281 iptcheckinput(a, {'double','uint8','int8','logical','uint16','int16','single','uint32', 'int32'}, ... error in ==> imhist @ 59 [a, n, isscaled, top, map] = parse_inputs(varargin{:}); appreciate i found solution, picture rgb , imhist work in 2-d input, need convert grascale with i=rgb2gray(i);

ibatis - mybatis update is not working -

i'm using mybatis update , query doesn't update table: can 1 me whats going wrong configuration <update id="updateinfo" parametertype="int" timeout="20"> update rule_details set state=0 severity ='info' , cfg_id=#{cfg_id} </update calling session.selectlist("updateinfo", cfg_id); and log shows debug java.sql.preparedstatement - ==> executing: update rule_details set state=0 severity ='warning' , cfg_id=? debug java.sql.preparedstatement - ==> parameters: 2572(integer) but database not updated data. can 1 please me.. use session.update() not session.selectlist().

streaming - Red5 video chat tutorial AS3 -

where can find working examples of video chat application based on as3 , red5? i'm having trouble understand how attach user stream user , vice-versa. can point simple example or provider sample code? here link simplechat demo project red5: http://www.red5.org/downloads/simpledemos/ anyway give basic concept: assuming have chat application, have single id each user, right? lets suppose scenario user a start streaming mic/cam user b : //start streaming mic , camera nspub = new netstream ( netconnection ); nspub.attachaudio(microphone.getmicrophone()); nspub.attachcamera(camera.getcamera()); nspub.publish('a'); //need send command user b notify him user started streaming, //this command can sent sharedobject or invoking remote method, //invoke client method in b //code receive mic/cam streaming user nscli = new netstream ( netconnection ); videocompoment.attachnetstream( nscli ); nscli.play('a');

c# - How to save in asp.net mvc multiple input boxes text in one record -

i'm new asp.net mvc. how can save text of 3 input textboxes 1 record concatenating them asp.net mvc? thanks html: @html.textbox("txtnumber") @html.textbox("txtmonth", null, new { maxlength = 2 }) @html.textbox("txtyear") controller: public actionresult addusa(formcollection form) { using (var db = new databaseimgrecentities()) { //db.images.add(new image } return redirecttoaction("index", "home"); } try inside action:- var allvalues = string.format("{0}{1}{2}", form["txtnumber"], form["txtmonth"], form["txtyear"]);

url rewriting - IE 10 $digest() iteration reached using fallback html5 mode (angularjs) -

from documentation of $location fallback legacy browsers browsers support html5 history api, $location uses html5 history api write path , search. if history api not supported browser, $location supplies hasbang url. frees having worry whether browser viewing app supports history api or not; $location service makes transparent you. it works fine under ff,chrome , ie10 (whatever browser mode). when try test in less ie9 mode, fallback mode hashbang behaves oddly. window location converted expected http://myserver.net/#!/thewebapp it displays server root content since angularjs fails during rendering. script5022: 10 $digest() iterations reached. aborting! after reading other q/a, suspect ie10 can't used way. source maybe server side rewriting or combination of both. right have no clue.

Show MSBuild command during build or package in output window of Visual Studio IDE? -

when visual studio build or package solution, output window comes with ------ build started: xxxx... but, can see actual command execute msbuild every switches, configured in project/solution? such as c:\xxx\yyy\msbuild.exe /t:compile /switches ... ------ build started: xxxx... i want make script automate packaging process. can create myself, it'd helpful if can see that.

python - store Latex in Json format -

i building math exercises database, use couchdb , store exercises in json format, can store meta-data each exercise. i have troubles having valid json latex syntax, way tackle issue? have thought encoding latex not sure it's idea, above if need decoded mobile device... example of data: {"taglist": null, "flagcount": null, "category": "algebre", "chapter": "polynomes", "difficulty": 1, "viewcount": null, "hint": null, "question": "soit $p \in \mathbb{r}[x]$ scindé sur $\mathbb{r}$.\\ \begin{enumerate} \item montrer que $p'$ est aussi scindé sur $\mathbb{r}$. \item montrer que les racines multiples de $p'$ sont aussi racines de $p$. \item ce resultat reste-t-il valable dans $\mathbb{c}[x]$ ? \end{enumerate}" "solution": null} moreover, might need encrypt "solution" because no want accessed wi

How do I output a CSV using PowerShell without the "#TYPE" line? -

this sort of related post. i've got following script written: get-aduser -filter * -searchbase 'dc=aaaa,dc=com' | export-csv "adusers.csv" this outputs csv file @ first row of file reads: #type selected.microsoft.activedirectory.management.aduser" this messing ssis when tries read it. there way of not adding first line? add notypeinformation switch, this: export-csv "../ssis/import data/adusers.csv" -notypeinformation

c# - block internet using wininet -

currently using wininet in c# application check internet connection working fine [dllimport("wininet.dll", setlasterror = true)] public extern static bool internetgetconnectedstate(out int lpdwflags, int dwreserved); [flags] public enum connectionstates { modem = 0x1, lan = 0x2, proxy = 0x4, rasinstalled = 0x10, offline = 0x20, configured = 0x40, } but problem want block internet not successful how achieve using wininet? thanks in advance one way using command prompt in program : if use command : rasdial /disconnect disconnect current internet connection internet for executing command in c# can use code : string command = "rasdial /disconnect"; system.diagnostics.processstartinfo procstartinfo = new system.diagnostics.processstartinfo("cmd", "/c " + command); procstartinfo.redirectstandardoutput = true; procst

Atomic changes with Simperium? -

is there way ensure ordered atomic change set simperium? i have data model has complex relationships associated. seems looking on things possible object graph enter in invalid state if communication pipe severed. there way indicate simperium group of changes belong together? helpful client or server prevent applying changes unless data "transaction" present keeping object graph in valid state. presently it's expected relationships marked optional, allows objects synced , stored in order without technically violating model structure. relationships lazily re-established simperium @ first opportunity, if connection severed , later restored. but approach pass burden application logic. code open source, , suggestions changes in regard welcome.

mongodb - Mongo record not updating, no error either -

here record want update: { "_id" : objectid("519177384e2e9fee10000000"), "fb_id" : { "0" : "2000" }, "name" : { "0" : "aaa bbb" }, "email" : { "0" : "abc@abc.com" } } i fb_id changed "2000" , instead of { "0" : "2000" } . i tried.. primary> db.users.update({fb_id : "{ 0 : 2000 }"},{$set: {fb_id: "2000"}}); it did not work did not through error either. doing wrong? you need move double quotes: db.users.update({fb_id : { "0" : "2000" }},{$set: {fb_id: "2000"}})

trying to extract contents.xml from openoffice spreadsheet ods file in c++ program -

anyone know of way unpack ods file , read contents.xml file? in program i'd able open ods file, , extract xml file parsing. ive looked @ minizip, ods file not zip file. there other way? any appreciated, alot, bryan despite file extension still zip archive, minizip should work. the original opendocument format consists of xml document has root element. opendocument files can take format of zip compressed archive containing number of files , directories; these can contain binary content , benefit zip's lossless compression reduce file size. source

html - Redirect to another page if time is less than a specific date and time -

i not have php capabilities on server. i'm hoping there html or js way of doing this? basically, don't want page show if time less specific date , time. so, if browse page, , time less time specified this, should redirect page. i'm wondering if can done without using js? because can redirect page within <meta> tag example redirect google.com: <!doctype html public "-//softquad//dtd hotmetal pro 4.0::19970714::extensions html 4.0//en" "hmpro4.dtd"> <html> <head> <title>redirector</title> <meta http-equiv="refresh" content="0; url=http://www.google.com"> </head> <body bgcolor="#ffffff"> </body> </html> really hoping can done without js, cause js might disabled on browsers. ofcourse, if there's no other way this, suppose, if js disabled, should redirect them anyways, can't see content. any appreciated. i have asp

javascript - Make HTML5 sandbox work for IE8/9 using polyfill or shim -

i make new html5 iframe attribute sandbox work in ie8 , 9. have googled day , tried many "libraries" supposed make html5 work, don't seem have "sandbox" included. so question; can find polyfill/shim/plugin/snippet or else make iframe sandbox work in ie8/9 ? as others have noted cannot work in javascript alone, best bet use security="restricted" ie attribute. see here : http://blogs.msdn.com/b/ie/archive/2008/01/18/using-frames-more-securely.aspx

java - Will this regex always work according to requirements stated below? -

is regex correct break sentence 3 tokens: characters before lowercased letters inside parentheses lowercase letters inside parentheses including parentheses characters after lowercased parentheses letters system.out.println("this (a) test".matches("^(.*)?\\([a-z]*\\)(.*)?$")); the string may or may not have parentheses lower cased letter , may appear anywhere in sentence. if see flaw in use case haven't considered, can provide correction in regex ? for e.g. above. group1 captures group2 captures (a) group3 captures test edit:: how change regex achieve following ? if string has (foo)(bar)(baz) how capture group1= empty group2=(foo) , group3=empty. , find above pattern thrice because there 3 parentheses. separate examining regex, whenever write regex, write series of unit tests cover each case. i'd suggest same. create 4 tests (at least) using regex , testing against strings: (a) test this (a) test this test (a) this test

app store - Iphone 5 support -

this question has answer here: how develop or migrate apps iphone 5 screen resolution? 30 answers today tried uploading update older iphone app app store denied because did not support new iphone 5 screen size. have rebuild whole app show on 4 inch display or can compile older 3.5 inch screens , other older apps centering black bars on top , bottom. you have rebuild app, launch image sized 5 inch screen. tells system app runs on 5 inch screen. (you can not older apps , show black bars. app was doing already. submitting update, , forbidden without running @ full size on iphone 5.) now, when app launches on 5 inch screen, might not without autoresizing or autolayout. that's issue. able tell pretty looking (in iphone 5 simulator).

eloquent - Laravel select last row on database table -

i want last file inserted in table. know method 'first' provides first file in table don't know how last insert. thx. you'll need order same field you're ordering now, descending. example, if have time stamp when upload done called upload_time , you'd this; for pre-laravel 4 return db::table('files')->order_by('upload_time', 'desc')->first(); for laravel 4 , onwards return db::table('files')->orderby('upload_time', 'desc')->first(); this order rows in files table upload time, descending order , , take first one. latest uploaded file.

java - Getting the value from custom List -

i have list name declared public , person class have setter , getters methods.in service class has executed method , has list of values. now want first name list. so try below... iterator<person> = name.iterator(); while(it.hasnext()) { name = (person)it.next(); string firsname=it.next(); } please correct me whats wrong here. no, code not going work, because second cast going fail: it.next() person , not string . here how can fix code: list<string> firstnames = new arraylist<string>(); iterator <person> = name.iterator(); // shouldn't persons.iterator() ? while (it.hasnext()) { person p = it.next(); // no need cast string firsname = p.getfirstname(); firstnames.add(firstname); } alternatively, can this: list<string> firstnames = new arraylist<string>(); (person p : persons) { firstnames.add(p.getfirstname()); }

android - App crashes on galaxy s3 with outofmemory error -

Image
my app works fine on 480*800 phones. crashes on 720p phones . tested on galaxy s3 , xperia sl. here logcat error and code causing error according judgment this mapview = new mapview(this) { @override public boolean ontouchevent(motionevent event) { if (gesturedetector.ontouchevent(event)) { return true; } return super.ontouchevent(event); } }; mapview.setclickable(true); mapview.setcenter(new geopoint(33.698351,73.063889)); mapview.zoom((byte) 12, 5); mapview.setbuiltinzoomcontrols(true); mapview.setmapfile(new file(environment.getexternalstoragedirectory()+"/pakistan.map"));

Dotnetnuke - How to insert a module inside another module? -

i writing tabs module in want able display other modules html, third-party modules etc. how achieve that? c# code please. http://www.mandeeps.com/products/dotnetnuke-modules/live-tabs.aspx this module tabs module looking do. don't think it's type of thing can code or copy , paste in here. use module, buy source of module or analyze source of dnn , figure out makes module render , reproduce that.

Delete row from mysql table where value not like -

i have table has results of tests. looks like: test | result math | pass science | fail history | cancelled french | absent the table named table1. want delete rows in table value of column result not "pass" or "fail" something like: delete table1 result not in (pass, fail); the resulting table like: test | result math | pass science | fail your example worked me adding quotes around pass , fail . delete table1 result not in ('pass', 'fail')

templates - C++ undefined reference to a linked function -

i have problem linking of c++ project , can't figure out what's wrong. jest of code. clitest.cpp #include <iostream> #include "node.h" using namespace std; int main(int argc, char** argv) { node<int> *ndnew = new node<int>(7); return 0; } node.h #ifndef node_h #define node_h #include <vector> template <typename t> class node { private: node<t>* ndfather; std::vector<node<t>* > vecsons; public: t* data; node(const t &data); }; #endif node.cpp #include "node.h" using namespace std; template <typename t> node<t>::node(const t &data) { this->data = &data; this->ndfather = 0; this->vecsons = (new vector<t>()); }; the compiler command used is g++ -wall -g clitest.cpp node.cpp -o clitest the error log goes this clitest.cpp: in function ‘int main(int, char**)’: clitest.cpp:8:16: warning: unused

php - Connect to MySQL in MAMP -

i'm trying make html form connect mysql database on mamp. however i'm not able open mysql connection. keep getting message "could not connect" my thoughts - the host incorrect the username and/or password incorrect. found information in config.inc.php, believe correct, there's possibility .. here's php script <?php class database { function insert() { $dbhost = 'localhost:8888'; $conn = mysql_connect($dbhost, 'root', 'root'); if (! $conn) { die('could not connect: ' . mysql_error()); } else { echo "connected"; } } } ?> possible solutions this thread : a) launch mamp, go preferences , set sql port 3306 . b) use set of commands: ps aux | grep mysql lsof -i killall -9 mysqld in terminal , restart mamp. have nice day.

In need of some advice controlling a C# winforms application via a asp.net website -

i'm working on little project basic youtube remote control, whereby have helper app running on pc, , can send commands website accessed via web browser on phone. reading through threads on other sites people trying same thing i've realized not concept people comfortable with, struggling think of way beyond writing native app phone , having communicate helper application internally via wlan(would happy this, don't have cash spring new mac develop iphone). if stick website/winforms model, there way in such way (most) people comfortable running? the ideas had far were: a) build web server helper app(though not sure of logistics of having host asp.net site) b) host site externally, , have helper app periodically poll database/webservice on server receive commands (sketchy , imagine resource heavy) sorry wall of text, i'm capable of running idea , building it, i'm not sure possible , considered 'best' way this. any advice appreciated. cheers

File on sd card displayed in android emulator's gallery app -

Image
i have created app lets user save image sd card, cannot see in gallery app on emulator. i'm not sure if need special code or need able find can see if code works. i need able find can see if code works. if ultimate objective see files on sd card, can achieved in several ways: use file explorer comes bundled in android debug monitor.*** login device/emulator shell, adb shell , , navigate sd card folder (that's @ /sdcard or /mnt/sdcard ) , use ls command list contents. install/use 1 of many available file explorer apps , navigate sd card through device/emulator ui. ***example: launch adm running monitor command (if sdk tools not in path, first navigate tools/ directory). there several perspectives: logcat, threads, heap, etc. need switch file explorer tab. above file explorer view galaxy nexus, actual path sd card may differ device/emulator.

vb.net - Download a folder from website to client machine in asp.net -

i have folder called "users" on server. there many users using website. for each user create different folder. folder's name user's name. in have default text files , folder called "uploaded" file uploaded user stored in "uploaded" folder. so specific user files in "users/username/uploaded". now want backup huge data on computer server. want download folder called "users". my site hosted on some.com. doesn't give facility download data on computer. so decided create download page me. now question how download folder named "users"? or how can convert folder zip? first downloaded zip file this link unzipped , added reference dll in third folder. the using section : using system.io; using icsharp.sharpziplib.zip; code : zipoutputstream zos; string strbasedir; protected void page_load(object sender, eventargs e) { startzip(server.mappath("directory name"),

LEDA library(C++ library) setup linux -

i want set leda library in system. i have downloaded leda library following link http://www.algorithmic-solutions.info/free/d5.php instruction given in read me file 2. preparations --------------- unpacking leda distribution file leda---.tar.gz create leda root directory "leda---". might want rename or move different place. let denote final complete path name of leda root directory. install , use unix object code of leda have modify environment follows: a) ledaroot: set environment variable ledaroot leda root directory: csh/tcsh: setenv ledaroot sh/bash: ledaroot= export ledaroot b) command search path: include $ledaroot/manual/cmd command search path (environment variable path (csh) or path (sh)) , call rehash (if required system). c) shared library: (for solaris, linux, irix, osf1) if planning use shared libraries include $ledaroot ld_librar

vba - I'm trying to bypass outlook alert using sendkeys, is this code correct? -

sub mail_workbook() dim wb workbook set wb = activeworkbook application.wait (now + timevalue("0:00:06")) application.sendkeys "{tab}", "false" application.sendkeys "{tab}", "false" application.sendkeys "{enter}" if val(application.version) >= 12 if wb.fileformat = 51 , wb.hasvbproject = true msgbox "there vba code in xlsx file removed if try send file." & vbnewline & _ "save file first xlsm , try macro again.", vbinformation exit sub end if end if on error resume next = 1 3 wb.sendmail array("email.person@company.com", "email.person2@company.com"), "test vba" if err.number = 0 exit next on error goto 0 end sub you need take @ outlook redemption: http://www.dimastr.com/redemption/home.htm this tool allows bypass outlook's security restrictions. here sample code product's site: http://www.dimastr.com/redemption/s

mp3 - Get Audio File Duration Via a Microsoft DLL or Utility -

is there windows dll or utility can used see duration (hh:mm:ss) of audio file (wma, mp3, or wav) can accessed script (specifically jscript)? i know there one, or else can read file metadata, i'm unfamiliar it. you can use getdetailsof method of windows shell folder object audio file length. technique supports audio file types metadata can read , displayed windows explorer natively. however, note index of length attribute different on different windows versions: it's 21 on windows xp/2003 , 27 on windows vista+. see this page , this answer details. need take account in script. example code: var length = 27; // windows vista+ // var length = 21; // windows xp var oshell = new activexobject("shell.application"); var ofolder = oshell.namespace("c:\music"); var ofile = ofolder.parsename("track.mp3"); wscript.echo(ofolder.getdetailsof(ofile, length)); example output: 00:05:18

ios - How to fix MP3AudioStream error? -

i'm getting following error randomly (and consistently on launch). can happen when there background threads , when there aren't , seems problem library i'm having trouble tracking down problem in code. breakpoint triggers on: #0 0x07bb489b in mp3audiostream::generatepackets(audiofilestreamcontinuation&) () and backtrace follows: * thread #1: tid = 0x1c03, 0x07bb489b audiotoolbox`mp3audiostream::generatepackets(audiofilestreamcontinuation&) + 2843, stop reason = exc_bad_access (code=2, address=0x4) frame #0: 0x07bb489b audiotoolbox`mp3audiostream::generatepackets(audiofilestreamcontinuation&) + 2843 frame #1: 0x07b92535 audiotoolbox`audiofilestreamwrapper::parsebytes(unsigned long, void const*, unsigned long) + 181 frame #2: 0x07b8f41d audiotoolbox`audiofilestreamparsebytes + 93 frame #3: 0x07f7a1be mediatoolbox`pushbytesthroughparser + 484 frame #4: 0x07f7a69a mediatoolbox`getaudiofilestreampacketandframecount + 221 frame #5: 0x07f7c57e mediatoolbox

Create KML route -

i trying create route based off lon & lat's. have far, doesn't seem working correctly. <?xml version="1.0" encoding="utf-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <document> <placemark> <name>test</name> <description>test desc</description> <point> <coordinates>-80.54400115,43.4250264</coordinates> <coordinates>-80.52674314,43.43127701</coordinates> ... </point> </placemark> </document> <kml> is syntax correct? when load in maps app, doesn't show route. please see kml reference kml xml case sensitive (placemark not same placemark) a <point> single location a line <linestring> your xml needs valid ( </kml> needed close opening <kml> ). example kml example above on google maps <?xml version="1.0" encoding="utf-8"

java - Getting started with JAXB -

schema root <xs:schema jxb:version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.w3.org/2001/xmlschema http://www.nubean.com/schemas/schema.xsd" > <xs:element name="usorcanadaaddress" > jaxb binding xml <?xml version='1.0' encoding='utf-8' ?> <jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/xmlschema" > <jxb:bindings node="/xs:schema" schemalocation="address.xsd" > <jxb:schemabindings> <jxb:package name="com.apress.jaxb1.example" ></jxb:package> </jxb:schemabindings> </jxb:bindings> </jxb:bindings> i beginning jaxb , these 2 tags came across in books. have few basic questions regar

How can I rewrite the following MS Word VBA macro to be compatible with Word 2007/2010/2013 -

i looking make ms word vba macro compatible word 2007,2010, , 2013 without having download ms office object libraries 12,14, , 15 on machines. types how can accomplish this? code following , seems require object library 12 & 14 or 15. doesn't work 12,14 or 15. data1 = inputbox("what moving water damage value (enter 0.0 - 1.0).") ' validiate data if data1 > 1 or data1 < 0 data1 = inputbox("invalid input. moving water damage value (enter 0.0 - 1.0).") end if loop until (data1 <= 1 , data1 >= 0) data2 = inputbox("what settlement damage value (enter 0.0 - 1.0).") if data2 > 1 or data2 < 0 data2 = inputbox("invalid input. settlement damage value (enter 0.0 - 1.0).") end if loop until (data2 <= 1 , data2 >= 0) data3 = inputbox("what pre-exisiting damage value (enter 0.0 - 1.0).") if data3 > 1 or data3 < 0 data3 = inputbox("invalid input. pre-exisiting damage value (enter 0.0 - 1.0).&qu

asp.net mvc - I copy/pasted code from ArcGIS .NET ashx proxy into my Controller method, now debugging is jumping all over the place (multi-threaded, apparently) -

i have controller takes in json data via http post. inside controller call method copied/pasted arcgis's .net implementation of proxy that's needed connect arcgis's servers. sake of problem i'm having, part irrelavent. before copying/pasting, execution flow line line. now, after copying , pasting (and subsequently adding call method), debugging execution flow jumping on place (because of different threads going on @ same time). don't know why happening- didn't see had threads in code copied , pasted. tell me why happening because of code copied/pasted appears not have multithreading? here's controller code makes call method copied/pasted: [httppost] public void postpicture(httprequestmessage msg) { httpcontext context = httpcontext.current; processrequest(context); ... here's code copied , pasted arcgis (i'm sorry, it's long): public void processrequest(httpcontext context) { httpresponse response

http status code 403 - Same URL showing different content (website is mine) -

ok, weird. we have test website (just payment form) here: http://blog.inglesen100dias.com/ the problem i've talked me can see form (our hosting provider, other coworkers in different states/countries, etc). me, see 403 forbidden error, "you don't have permission access / on server." we made change earlier today in subdomain, changing record point different server. reason me can see new page it's pointing at. i've deleted cache, flushed dns (i'm on windows 8), entered website cellphone (same error)... don't know else do. impresion when access url, it's still trying open location in old server (where domain pointed), instead of in new server. why happens me? any advice welcome! update i've turned-off wifi in cellphone (it's connected same network computer) , shows right page! if turn wifi on, shows 403 error again... can problem in router? i restarted router , it's showing right page!

How to build and install cmake targets only if the other targets depend on them? -

my application consists of core, many shared libraries , many plugins use these shared libraries. i'm using cmake option() command enable / disable each plugin. what i'd build , install shared library if it's required 1 of enabled plugins. i tried using following in directories of shared libraries: set_directory_properties(properties exclude_from_all true) however, targets still being built in visual studio. gnu make in linux correctly avoids building them. however, required libraries no longer installed using install() in either system. i tried adding exclude_from_default_build false library targets, cmake complained undefined behavior of install() disabled targets.

javascript - array adding function in object literal notation -

here code using, not quite sure how use literal notation yet, have pass currentactivecategories function somehow. not sure if preferred way it, dont want learn bad habits. var primarycare = { currentactivecategories : [ "1", "2"], currentvalue : addvalues(this.currentactivecategories) } function addvalues(activecategories) { temptotal; for(int = 0; < activecategories.length; i++){ temptotal += activecategories[i]; } return temptotal; } currently object literal creates object 2 properties, currentactivecategories , array, , currentvalue , set result of calling addvalues() at time object literal evaluated. trying call function this.currentactivecategories , undefined , because this not equal object @ moment. if idea have function can return current total @ time can this: var primarycare = { currentactivecategories : [ "1", "2"], currentvalue : function () { var

facebook - Application code signing -

does facebook mandate particular level/standards of code signing? seems me using self-signed certificates (rather reputable roots such godaddy or globalsign) work. missing something? haven't come across clear specs it. thanks, dhruv

performance - How to tune self-join table in mysql like this? -

i have table i'm trying select , date. query took 2 min run on 4 million records. i'm not sure how more can squeeze out of query. select c.fk_id, c.from_date, c.fk_pb, min(o.from_date) to_date table_x c inner join table_x o on c.fk_id = o.fk_id , c.fk_pb = o.fk_pb o.from_date > c.from_date group c.fk_id, c.from_date, c.fk_pb there indexes on from_date, fk_pb , fk_id already. the schema this. +-----------------------------+---------------+------+-----+---------+-------+ | field | type | null | key | default | | +-----------------------------+---------------+------+-----+---------+-------+ | fk_id | int(11) | yes | mul | null | | | fk_pb | int(11) | yes | mul | null | | | from_date | date | yes | mul | null | | | to_date | date | yes | | null | | +-

image - Drupal Background Photo -

this site: http://www.rybm.org/ there supposed full background called bg.jpg. displays on local xammp run drupal 7 install, not work on live site. it declared in styles.css body tag, this: background-image:url('wo77crop.jpg'); any ideas on why display correctly on local install, not server? put image in same folder (css) stylesheet dbeclared on, absolutely wasn't happening because pointing wrong directory. so, image in css folder, along stylesheet. i'm still wondering if it's not directory issue? that image pointing http://www.rybm.org/sites/all/themes/skeletontheme/css/bg.jpg use: background-image: url('bg.jpg'); and css file specifying in css directory. without knowing saved image, can't tell path should be. if in images folder @ same level css folder, you'd do: background-image: url('../images/bg.jpg');

python - No JSON object could be decoded when opening stackexchange api as json -

i accessing particular url json file (fromt stackexchange , stackoverflow api). while executing json.loads() command shows following error: import urllib2 import json url = "http://api.stackexchange.com/2.1/tags?order=desc&sort=popular&site=quant&pagesize=100&page=1" data = json.loads(urllib2.urlopen(url).read()) <ipython-input-20-7540e91a8ff2> in <module>() ----> 1 data = json.loads(urllib2.urlopen(url).read()) /usr/lib/python2.7/json/__init__.pyc in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 336 parse_int none , parse_float none , 337 parse_constant none , object_pairs_hook none , not kw): --> 338 return _default_decoder.decode(s) 339 if cls none: 340 cls = jsondecoder /usr/lib/python2.7/json/decoder.pyc in decode(self, s, _w) 363 364 """ --> 365 obj, end = self.raw_

aapt - Automated Way to Find Android Activity -

i have built script, part of automation tool i've developed, needs open apk , find activity can launch it. have used: aapt dump badging x.apk which 'should' dump out activity(s) of application. times has, others has not. there more reliable method dump activities of application script can pick activity , launch package via adb instrumentation? you can use $ aapt dump --values xmltree <name>.apk androidmanifest.xml and have parse output find activities. remember have find instrumentation in manifest if intention run instrumentation automatically.

php - How to split an array into two table rows "<tr>" within one foreach on template side -

due working restricted working environment, need put half of array 1 table row , half . this array (already sorted in order of need): array ( [product] => kfe-1221 [description] => classic blue [current_stock] => 630 [purchase_order] => [total_sales] => 0 [avail_to_sell] => 630 [size_run1] => 15 [size_run2] => 62 [size_run3] => 122 [size_run4] => 113 [size_run5] => 102 [size_run6] => 92 [size_run7] => 63 [size_run8] => 61 [size_run9] => 0 [size_run10] => 0 ) i need split array @ "size_run1" - "size_run10" separate table row. previously, had display array table (standard foreach) when didn't need size_run. due request adding in. (and yes using deprecated php) <?php while($data = mssql_fetch_assoc($result_ats)) { if ($data['avail_to_sell'] <= 0){ echo '<tr clas