Posts

Showing posts from June, 2011

php - database not read from mysql database -

this question has answer here: how useful error messages in php? 27 answers php header location-redirect doesn't work - why? [duplicate] 4 answers my login page doesnt redirect me next webpage if inputted correct data on username , password. when check config.inc , made config.php it doesnt displays on webpage. any suggestions config.inc $con=mysqli_connect("localhost","root@localhost","","test"); // check connection if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } loginproc page <?php // inialize session session_start(); // include database connection settings include('config.inc'); // retrieve username , password database according user's input $...

html - Making two other div's change color when hovering over main div -

i have 3 div's. change stuff in 2 of div's when hover on "main"/"first" div. really, really trying avoid use of javascript/jquery, here. i pretty sure can done, vaguely remember reading while ago cannot find link again , previous searches have not helped, because might not using correct terms. here's code : html: <div id=one></div> <div id=two></div> <div id=three></div> css: #one{background-color:blue;width:50px;height:50px;float:left;} #two{background-color:green;width:50px;height:50px;float:left;} #three{background-color:red;width:50px;height:50px;float:right;} #one:hover > #two + #three { background-color: yellow; } can please help? how make other two divs change color when hover on first one? do mean this? fiddle #one:hover ~ #two , #one:hover ~ #three { background-color: yellow; } issue > mean immediate descendant selector , combination of selector + won't work. ...

erlang - Mnesia - Check for a value in either of the keys in the table -

i have mnesia table "users" created following record -record(users,{username,nickname,age}) let's have mnesia table following records users | username | nickname | age users | john | baddy | 25 users | monk | john | 26 i have name match table...(say "john")..i want select or match rows has "john" either username or nickname...how can achieve this? if can suggest me way, happy... thanks have @ qlc - there's simple example here on learn erlang , or man page here . can use booleans match e.g. (in pseudocode) (username == john or nickname == john).

csv - sqlplus export vis cmd -

i'm trying export data csv sql plus via cmd line keep getting error: sp2-0042 unknown command " s" - rest of line ignored. i'm running sqlplus user/pass@server @exportdata.sql and script looks this set underline off set colsep , set lines 1000 pages 1000 set feedback off set heading on spool c:\networkthresholdtriggers\arl1_1x.csv select t1.bsm_nm, t1.d_dtm datetime, sum(v_att_cnt) v_att_cnt, sum(v_drp_call_cnt) v_drp_call_cnt (select bsm_nm, max(d_dtm) maxdatetime ds3r_fh_1xrtt_bts_lvl_kpi group bsm_nm) t2 inner join ds3r_fh_1xrtt_bts_lvl_kpi t1 on t1.bsm_nm = t2.bsm_nm , t1.d_dtm = t2.maxdatetime , t1.bsm_nm = 'arl1' group t1.bsm_nm, t1.d_dtm having case when sum(v_att_cnt) = 0 0 else sum(v_drp_call_cnt)/sum(v_att_cnt) end >= .01; spool off whats weird if login sqlplus this sqlplus user/pass@server and paste in code, works. why doesn...

linux - statsd current time is two hours in the future--how to fix? -

when looking @ our statsd data in graphite, graphs saying current time 2 hours in future. instance, if we're looking @ graphite @ 9:00am, graphs telling it's 11:00am. data lines should--if had 99 events @ 9:00am, can see 99 events on graphs @ 11:00am. the clock correct on host running statsd, , tried stopping & starting statsd process. other suggestions on fix that? fixed creating file (since we're in california) $ cat /opt/graphite/webapp/graphite/local_settings.py # set local timezone (django *try* figure out automatically) # if graphs appear offset couple hours # needs explicitly set local timezone. time_zone = 'america/los_angeles' found answer here

php - Selecting only 1 checkbox (Don't think I can use radio buttons) -

i have bit of issue need with. i have whole heap of images need either "accepted" or "rejected" page have heap of images accept , reject checkbox , save button @ bottom of page. these images gd generated images string pulled mysql database. these images generated , displayed using while loop in php. my issue @ moment checkboxes can both selected @ same time , doesnt make sense able accept , reject @ same time. understand radio buttons isn't possible me have form every image , have able distinguish accept/rejection each image in next action page. this have can't making form on , on while im looping. echo "<form name=\"selections\" action=\"processselections.php\" method=\"post\">"; echo "<div>"; echo "accept: <input type=\"checkbox\" name=\"accept\" value=\"accept" . $row[0] . " class=\"checkbox\"\">&nbsp;&nbsp;&nb...

widget - Null Pointer implementing Android Wheel -

i'm trying implement yuri kanivets' android wheel picker. trying place few strings onto single wheel. makes implementation little different trying display wheel on alertdialog.builder. can empty wheel appear on dialog, can't seem populate anything. every time try add values wheel, null pointer exception. if familiar this, can see doing wrong? suspect context using in arraywheeladapter wrong, don't know how else it. here code: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_find_events); layoutinflater inflater = layoutinflater.from(this); builderview = inflater.inflate(r.layout.wheel_range_layout, null); alertdialog.builder builder = new alertdialog.builder(this); builder.setview(builderview); alert = builder.create(); final wheelview range = (wheelview) findviewbyid(r.id.range); int defaultrange = 0; string ranges[] = new string[...

c++ - Recursive function that takes the sum of odd integers -

the program runs spews out other stuff , not sure why. first output correct there not sure happens. here code: #include <iostream> using namespace std; const int max = 10; int sum(int arraynum[], int n) { int total = 0; if (n <= 0) return 0; else for(int = 0; < max; ++) { if(arraynum[i] % 2 != 0) total += arraynum[i]; } cout << "sum of odd integers in array: " << total << endl; return arraynum[0] + sum(arraynum+1,n-1); } int main() { int x[max] = {13,14,8,7,45,89,22,18,6,10}; sum(x,max); system("pause"); return 0; } the term recursion means (in simplest variation) solving problem reducing simpler version of same problem until becomes trivial. in example... to compute num of odd values in array of n elements have these cases: the array empty: result trivially 0 the first element even: result sum of odd elements...

java - custom compile time error -

i want show compile time error when call method. like have class "myclass" in there 2 methods "methoda()" , "methodb()". make instance of "myclass" . using instance can call both methods need show compile time error if call "methodb()" before "methoda()"; strong text class myclasss { public void methoda() { //do thing } public void methodb() { //do thing } } class myrunningclasss { public static void main(string... args) { myclass mc = new myclass(); // not give compile time error. mc.methoda(); mc.methodb(); // have give compile time error. mc.methodb(); mc.methoda(); } } what suggesting isn't easy. need download openjdk , change it. it's large code base don't suggest that. instead suggest add runtime assertion check , unit test code. if use maven or ant run tests part of build, th...

osgi - Apache Felix File Install example -

is there example of how configure/install apache felix file install? in official website, has been mentioned need configure properties etc. no way have mentioned need put configuration properties, how set etc. i have downloaded org.apache.felix.fileinstall-3.2.6.jar file , have felix framework installed. not getting should put configuration properties file install read that. can guide me on this? as specified in file install docs can provide configuration via system properties. below steps work felix started standard distribution download felix here unzip content download file install bundle here , copy bundle folder. default felix auto deploy bundles folder. create folder named deploy . directory configured file install start felix java -dfelix.fileinstall.dir=./deploy -jar bin/felix.jar . now jar added deploy folder installed file install bundle

javascript - Access array element with a dot in its name -

i'm reading data database , loading in array. when print console this: [ {'person.name':'name1', total:1}, {'person.name':'name2', total:100} ] so iterate through code: for(var i=0;i<arr.length;i++){ console.log(arr[i].total); } i can access total how can access 'person.name'? access array : arr[i]['person.name']; here's more info on why/when use notation : javascript property access: dot notation vs. brackets?

java - How to test the response content-type using SOAP UI -

i new soap ui . got requirement test if response body not empty . can please tell me how solve. my idea check content-length of response using assertion script not working equals() . contains() working not equals : // works: assert ((com.eviware.soapui.support.types.stringlist)messageexchange.responseheaders["content-length"]).contains("0") // not working: assert ((com.eviware.soapui.support.types.stringlist)messageexchange.responseheaders["c‌​ontent-length"]).equals("0") // not working: assert ((com.eviware.soapui.support.types.stringlist)messageexchange.responseheaders["c‌​ontent-length"]) == 0 please me solve issue. in code: // works: assert ((com.eviware.soapui.support.types.stringlist)messageexchange.responseheaders["content-length"]).contains("0") // not working: assert ((com.eviware.soapui.support.types.stringlist)messageexchange.responseheaders["c‌​ontent-length"]).equal...

javascript - LinkButton value lost on PostBack -

i have table i'm creating rows/cells in code behind, , adding various controls each cell. there submit button on form. one of cells contains splinkbutton . have javascript function changes innertext/textcontent based on user action default value set in code behind. prior clicking button run code behind, end user see updated text of splinkbutton . when submit button clicked, control reverts value default value during button's postback . label/textbox/ddl preserve values. if wrap control in ispostback , cell control added null (or if wrap entire table, there no rows). note i'm using value of item uniquely append splinkbutton id on per-table row basis. what different linkbutton/splinkbutton , postback behavior? edit: converted splinkbutton textbox, providing similar functionality. while dislike presentation compared textbox (look , feel, splinkbutton automatically expand modal size when needed), function. love splinkbutton working , go using it, if po...

class - c++ how to create classes that are interdependent -

i have storage class. members of class modified. each time member modified, i'd save state of class (clone class instance , save it). i'd create new class, save these states. for example: say have storage class in file storage.h class storage { public: int m_cnt; <lots of other members...> storagehistory m_his; }; and storagehistory class in file storagehistory.h class storagehistory { public: std::vector<storage> m_history_vec; }; assumptions: storagehistory class should kept in storage class. reason storage class main class can accessed in classes/packages. minimize changes in code, i'd s toragehistory coupled storage class. storagehistory cannot static or singleton since multiple instance of storage created. problems: cannot compile code. storage.h needs compiled before storagehistory.h , vice versa if storagehistory cannot stored in storage class keep it? owner of class? need define connection between th...

c# - Disabling labels in Windows Phone 8 Map Control -

is there way disable place names, road names, etc. showing on microsoft.phone.maps.controls.map control? i'm showing custom tilesource on top of bing basemap labels still showing through on top of custom tile source. ideally i'd turn bing base map off , replace own under impression that's not possible control. i'm using next best approach. thanks in advance ideas! even though it's marked depreciated, i've gone wp7 microsoft.phone.controls.maps.map has functionality require. i've encapsulated control , functionality within usercontrol it's easy swap out once new microsoft.phone.maps.controls.map control has caught functionality wise. /// <summary> /// sets tilesource exclusive maptilelayer /// </summary> private void refreshtilesource() { (var = map.children.count - 1; >= 0; i--) { maptilelayer tilelayer = map.children[i] maptilelayer; if (tilelayer != null) { map.children.rem...

cmake - cpack component level install -

for example cmakelists.txt attached cmake wiki. added below actual make command create component based tgz. confused , not seeing in documents. cmakelists.txt cmake_minimum_required(version 2.6.0 fatal_error) project(mylib) if(cmake_install_prefix_initialized_to_default) set(cmake_install_prefix "/usr" cache path "install path prefix prepended on install directories." force) endif(cmake_install_prefix_initialized_to_default) set(cpack_package_name "mylib") set(cpack_package_vendor "cmake.org") set(cpack_package_description_summary "mylib - cpack component installation example") set(cpack_package_version "1.0.0") set(cpack_package_version_major "1") set(cpack_package_version_minor "0") set(cpack_package_version_patch "0") set(cpack_package_install_directory "cpack component example") add_library(mylib mylib.cpp) add_executable(mylibapp mylibapp.cpp) target_link_libraries(...

dojo - 100 is showing as 10,000% NumberTextBox -

i set constraint use type set percent, value of 100 showing 10,000% once numerictextbox renders <div id="percentage" data-dojo-type="ourcompay.numbertextbox" data-dojo-props="constraints:{type: 'percent'}" title="percentage" required="true"></div> not sure fix this. bug dojo or i'm not doing right? not quite sure. i assume given percentage representation of amount of in hundreths of unit it's doing intends - i.e. if supplying value of 100 , expecting mean 100% you're not understanding percentages are. 1 100%.

ios - Abpersonviewcontroller showing no details -

i want show user contact page of person showing null . code below getting black contact page empty imagebox abpersonviewcontroller *personcontroller = [[abpersonviewcontroller alloc] init]; nsdictionary *dic = [arraydata objectatindex:indexpath.row]; abrecordref ref = (__bridge abrecordref)[dic objectforkey:@"abrecordref"]; abaddressbookref addressbook = abaddressbookcreate(); nslog(@"%@",ref); abrecordid recid = abrecordgetrecordid(ref); personcontroller.displayedperson = abaddressbookgetpersonwithrecordid(addressbook, recid); personcontroller.displayedproperties = [nsarray arraywithobjects: [nsnumber numberwithint: kabpersonnicknameproperty], [nsnumber numberwithint: kabpersonphonemobilelabel], [nsnumber numberwithint:kabpersonaddressproperty], nil]; personcontroller.allowsediting = yes; ...

Cakephp: pass parameter or data to another page -

our group create database patron attend event (booking) has lots of entities. we have 3 tables: patron, booking, booking_patron (join table). we want create 2 pages in view (add.ctp , add2.ctp) of booking_patron. page add.ctp has drop down box lists booking id , submit button. page add2.ctp should appear booking id chose before (in add.ctp). in add2.ctp, did make function user can create patron , assign patron booking id. bookingspatronscontroller.php public function add() { $bookings = $this->bookingspatron->booking->find('list'); $this->set(compact('bookings', 'patrons')); } public function add2($booking_id = null) { $patrons = $this->bookingspatron->patron->find('list'); $bookings = $this->bookingspatron->booking->find('list'); $this->set(compact('bookings', 'patrons')); if ($this->request->is('post')) { $this->bookingspatron->pa...

objective c - objc Separating tuples -

ran simple objc problem , need help. i'm sending query server gives me tuple wrapped in json. using dictionary sort out. - (void)viewdidload { [super viewdidload]; nodes *node = [nodes new]; nsdictionary *jsondict = [node nodeactivityfornode:@"17" withdates:nil and:nil]; nsdictionary *jsonactivitydict = [jsondict objectforkey:@"activity"]; nslog(@"activity?: %@", jsonactivitydict); } and heres debug dump activity?: ( ( "2013-05-21 16:58:32", 0 ), ( "2013-05-21 16:58:15", 0 ), ( "2013-05-21 16:57:59", 0 ), i'm trying split comma separated values can put them in individual int , string objects cant think of how in there. appreciated. thanks! the "activity" data looks array of arrays, not dictionary. if know 3 pairs of values , want 6 values put 6 separate variables this: nsdictionary *jsondict = [node nodeactivityfornode:@"17" withdates:nil...

objective c - real time analytics for ios -

i wan integrate analytics in 1 of project. know flurry analytics , google analytics options, both of these server not tracking realtime data. shows update after few hours on dashboard. is there real time analytics tool/library available can integrate ios app? on google analytics, there real time tab, can watch how many users using app, from, version of app using,...

c# - Changing text in another form by clicking a button -

Image
i've been trying change text of textbox in form1 clicking button (button1 in form2 "starta") in form2 , spent 2 hours (i'm programming-newbie!). have been searching around similiar questions , found bunch, after trying lot of them can't work. form1[design] form2[design] the method i'm trying right found here in form1 wrote this: public string starttid { { return this.textbox3.text; } set { this.textbox3.text = value; } } i know doesn't quite make sense , set empty textbox, i've tried many different solutions think should work, textbox's text wont change when click button! in form2, when button1 clicked, wrote this: string tiden = datetime.now.tostring("hh:mm:ss tt"); form1 first = new form1(); first.starttid = tiden; what i'm trying do, want text in textbox3 in form1 change current time when button1 in form2 pressed. sorry if post bit messy, it's first , english isn...

Working of pre-fix increment in Java -

this question has answer here: how post increment (i++) , pre increment (++i) operators work in java? 11 answers what control flow of post-increment operator? public class postincrement { public static void main(string[] args) { int = 0; for(int i=0;i< 2 ;i++) { =a++; } for(int i=0 ;i< 1;i++) { a++; } system.out.println("result2 :"+" "+a); } } the results 0 , 1 why so? the postfix operator ++ executes after statement completes. the first time print value of a prints 0 because nothing has changed. next, enter loop executes once, incrementing value of a. doesn't matter postincrement because there no other instructions in statement. value of a 1 . you print out 1 . as aside, code doesn't work becau...

java - Replace Last Occurrence of a character in a string -

this question has answer here: replace last part of string 9 answers i having string this "position, fix, dial" i want replace last double quote(") escape double quote(\") the result of string "position, fix, dial\" how can this. aware of replacing first occurrence of string. don't know how replace last occurrence of string string str = "\"position, fix, dial\""; int ind = str.lastindexof("\""); if( ind>=0 ) str = new stringbuilder(str).replace(ind, ind+1,"\\\"").tostring(); system.out.println(str);

asp.net mvc 3 - How Authorize attribute work in MVC3 -

i research mvc3 , read alot article or watch video on asp.net website. after have knowledge mvc3 , have question authorize attribute authenticate user login or not. default code when create page authenticate user this: [httppost] public actionresult logon(logonmodel model, string returnurl) { if (modelstate.isvalid) { if (membership.validateuser(model.username, model.password)) { formsauthentication.setauthcookie(model.username, model.rememberme); if (url.islocalurl(returnurl) && returnurl.length > 1 && returnurl.startswith("/") && !returnurl.startswith("//") && !returnurl.startswith("/\\")) { return redirect(returnurl); } else { return redirecttoaction("index", "home"); } ...

android - How to get data from html page using java? -

how data xml/html page? i'd make android app, in users notification of school-lesson fell out. website looks like: http://www.anony.ws/image/pc9 users fill in school class (klas) after installation of app. want pick data table, users should receive notification if it's class. (example: if ( userclass == klas ), alert ("hey, " + + " " + + "because of" + opmerking); something that. have no idea how should pick data out of table, it's weird page. makes more difficult because page fades (1/2) (2/2) (max 10 listings each page, 50 listings = 5 pages) , find out example here: http://suse.ghlyceum.nl/dagrooster/lwoo/ . how should pick data , put them in java vars! example code need pick things out <tr class='list odd'> <td class="list" align="center">6v</td> <td class="list" align="center">5</td> <td class="list" align="center">fa...

goutte - Mink - Could not retrieve Microsoft served pages -

i have code require_once(dirname(__file__) . '/../inc/mink.phar'); $url = 'http://some-asp-sites.com/'; // instantiate mink's goutte driver $guzzle_client_options = array( 'curl.options' => array( 'curlopt_ssl_verifypeer' => false, 'curlopt_certinfo' => false, 'curlopt_timeout' => 120 ), 'ssl.certificate_authority' => 'system' ); $client = new \behat\mink\driver\goutte\client(); $client->setclient(new \guzzle\http\client($url, $guzzle_client_options)); $driver = new \behat\mink\driver\gouttedriver($client); // initialize mink $session = new \behat\mink\session($driver); // start session $session->start(); // open form page $session->visit($url); var_dump($session->getresponseheaders()); and when try using code on pages has part of response headers as 'server' => array 0 => string 'microsoft-httpapi/2.0...

iphone - how to make an ImageView zoomable with or without ScrollView.? -

i have uimageview in ib , added map image on uimageview . want make image pinch zoomable. here code: - (void)viewdidload { [super viewdidload]; self.title = @"map"; self.mapimageview.contentmode = uiviewcontentmodescaleaspectfit; [self.mapscrollview addsubview:self.mapimageview]; [self.mapscrollview setcontentsize:cgsizemake(self.mapimageview.frame.size.width, self.mapimageview.frame.size.height)]; [self.mapscrollview setminimumzoomscale:1.0]; [self.mapscrollview setmaximumzoomscale:4.0]; } - (uiview *)viewforzoominginscrollview:(uiscrollview *)scrollview { return self.mapimageview; } but doesn't help, can see uiscrollview coming nothing happen image. in advance. try this //at viewdidload (or whare create mapimageview) uipinchgesturerecognizer *pinchrecognizer = [[uipinchgesturerecognizer alloc] initwithtarget:self action:@selector(scale:)]; [pinchrecognizer setdelegate:self]; [mapimageview addgesturerecogni...

GDAL in iOS, runtime dll proj4 not available, OGR functions do not work -

i have problems gdal compiled on ios ( gdal internally uses proj operations ) i'm developing ios, , want use library perform coordinate transformation, functions requires proj dll , @ runtime error : error 6: unable load proj.4 library (libproj.dylib), creation of ogrcoordinatetransformation failed. transformation failed. i suppose proj dll should included static library , can't find how todo this ( other problems, mention: can't access epsg database , gcs.csv neither, setgeogcs() methos seems available set coordinate system, bu don't' know parameters should use " epsg:3003 " coordinate system, "italia fuso ovest" ) cllocationcoordinate2d transform( char *s_srs, double x, double y) { ogrspatialreference osourcesrs, otargetsrs; ogrcoordinatetransformation *poct; /* osourcesrs.importfromepsg( atoi(papszargv[i+1]) ); //otargetsrs.importfromepsg( atoi(papszargv[i+2]) ); */ /* osourcesrs.setwellknowngeog...

php - How to gather a jQuery object into the .on event using parameters rather than being in the global scope? -

that tricky question phrase. elaborate. i have object datatable in case, jquery object. i listen button click .on click event , call function called checkbox parameter of object: var temporaryfilestable; $(document).ready(function() { temporaryfilestable = $("#temporaryfilestable").datatable(); $("#checkboxbutton").on('click', function() { checkbox(temporaryfilestable); }); }); this works fine , temporaryfilestable passes object function checkbox. the object "temporaryfilestable" reference datatable - both called within document ready of ajax triggered php / js file. in .js file store of reusable functions have function checkbox(checkboxtable). this function creates modal has several buttons on. want use these buttons call functions such selectfiltered(checkboxtable). because function checkbox(temporaryfilestable) brings in table object need reuse object trigger next function. used passing variables p...

Hiding Cells in Excel with a macro -

i desperatly looking excel macro hide rows if criteria met. have tried enter code provided in other question answers , cannot damn thing run. my code below runs wonderfully without row hidden part i need following calc before template generated if range f30 j30 blank rows 29 30 must hidden if range f33 j33 blank rows 32 33 must hidden if range f30 j33 blank rows 28 35 must hidden can please assist me function rangename(sname string) string rangename = application.substitute(sname, " ", "_") end function sub mergeprint() dim wsform worksheet, wsdata worksheet dim srngname string, r long, c integer set wsform = worksheets("template") set wsdata = worksheets("datasource") wsdata.cells(1, 1).currentregion r = 2 .rows.count if not wsdata.cells(r, 1).entirerow.hidden c = 1 .columns.count srngname = wsdata.cells(1, c).value range(rangename(srngname)).value = wsdata.cells(r, c) next wsform.printout end if next end end sub you use f...

security - check script for defeating "Price-Jacking" -

here fourth part of ipn-security-ckeck. need check whether it´s secure: // check number4 --------------------------------------------------------- $product_id_string = $_post['custom']; $product_id_string = rtrim($product_id_string, ","); // remove last comma // explode string, make array; check payment ! $id_values = array(); $id_str_array = explode(",", $product_id_string); $fullamount = 0; foreach ($id_str_array $key => $value) { $id_quantity_pair = explode("-", $value); $product_id = $id_quantity_pair[0]; // product id $product_quantity = $id_quantity_pair[1]; // quantity if (1 != intval($product_quantity)) { // manipulating item´s quantity $message = "somebody manipulating item´s quantity"; mail("me@myemail.de", "quantity hack", $message, "from: me@myemail.de" ); exit() } // remember item´s id $id_values[$key] = intval($product_id); } $sql = ...

ruby - How to find the dates which are there in a week or month till date -

how find dates there in week or month till date. days_for_week should return 19,20,21 (assuming current date 21st) days_for_month should return 1..21 (assuming current date 21st) active support provides lot of useful methods at_beginning_of_week , at_end_of_week , at_beginning_of_month etc .. > date.today.at_beginning_of_week => mon, 20 may 2013 for particular case, do > (date.today.at_beginning_of_week..date.today).map &:day => [20, 21] similarly > (date.today.at_beginning_of_month..date.today).map &:day => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] or simply > 1..date.today.day

asp.net - JQuery getJSON() not working when checking email -

i have registration page checks webmethod see if particular value exists in db. for email validation, have //checks email against database. $(emailtextbox).blur(function () { if ($(this).val()) { email = encodeuri(escape($(this).val())); alert(email); $.getjson('/checkavailable.aspx?' + email + ".email", function (results) { if (results.email == "true") { availabilityemail.html('<img src="/app_themes/defaulttheme/misc/tick.png"/>'); email = true; checkvalid(); } else { availabilityemail.html('<img src="/app_themes/defaulttheme/misc/cross.png"/>'); email = false; checkvalid(); } }); } }); which uses private string getemail(string email) { const string strsql = "select memberemail someview memberemail = @email"...

iframe - Print a document with JavaScript -

i want open print dialog file (docx,pdf,...) via sharepoint workflow. there call url , pass url of file after ? this: http://www.sharepoint_intranet.com/print.html?link-to-file.pdf edit: tried: <script type="text/javascript"> //get url of file var urloffile = window.location.search.replace("?", ""); document.write("<iframe id=" + "printdocument" + " src=" + "'" + urloffile + "'" + " width=" + "600" + " height=" + "400" + "></iframe>"); window.frames['printdocument'].focus(); window.frames['printdocument'].print(); </script> the print dialog opening , in print options there point "only selected frame" selected when press print button nothing happen. thanks help! you can put in body of html <body onload="window.print();"> so page opene...

linked list - Assembly set address to point to an address -

i'm trying build linked list in assembly (dont ask why), linked list has in stack built. i'm using nasm intel 80x86 on ubuntu linked list: size_i: struc node data: resb 1 next: resb 4 endstruc size_of_struct: equ $-size_i this stack: create_stack: push stksz*4 call malloc add esp,4 ;correct push mov dword[my_stack],eax ret now, read number user , each byte addressed different node in list. how try create new list: create_new_list: push size_of_struct call malloc ;now eax has pointer location add esp,4 ;correct push mov edx,0 mov dl,byte[ebx] ;dl data of current number (current digit) mov byte[eax+data],dl ;set data mov dword[eax+next],0 ;set next null ;build first node in eax push edx push ecx push eax mov eax,0 mov ecx,dword[my_stack] mov dword[curr_stack_pointer],ecx mov ecx,0 mov cl,byte[counter] mov al,4 mul cl add dword[curr_stack_pointer],eax ;dword[curr...

Pushing over SSH to a GIT repository with Xcode 4.6 -

Image
i using xcode 4.6 develop projects , using local repository feature. able push repository remote ssh server. i have tried following did not work : went organizer , repository, have added new remote following instructions : - name : name have put project name - location : have put ssh path : user@domain:path_to_my_.git_folder then have entered ssh password, there no confirmation button though. once done returned development window , went file->source control->push says there no remote found. so know should make work. thank you. i have found best solution repo's on github , bitbucket create ssh key-pair no password. $ cd .ssh $ ssh-keygen -t rsa -b 2048 -f github_id_rsa $ vi config then add following: host github hostname github.com user git identityfile ~/.ssh/github_id_rsa and refer repo as: ssh://github/trojanfoe/myrepo ^^^^^^ (note that's name of "host" config file, not github.com) this works in xcode, see...

php - Copy tree structure recursive - Adjacency List Model -

i try copy tree structure 1 database table another. structure adjacency list model. looks like: id|parent_id|position 1|0|1 2|1|1 3|1|2 4|0|2 5|4|1 it necessary id's regenerated (autoinc) in other table! have following functions: /** * copy single node , return new id */ public function copynode($sn_data){ $this->db2->insert('items_configurations', $sn_data); return $this->db2->insert_id(); } /** * return list of child nodes assoziative array * given parent */ public function childlist($parent_id){ $tmp = 'select parent_id,item_id,template_id,position items_templates parent_id='.$parent_id; $tmp .= ' order position'; $query=$this->db2->query($tmp); return $query->result_array(); } /** * copy whole tree structure through recursive function */ public function copytree($node_data,$given_parent){ $new_parent = $this->copynode($node_data); $new_data = $this->childlist($node_data[...

android - Devices being filtered by Play Store as Not Compatible -

from user feedback, play denying 1 of our apps "not compatible" several devices. e.g: samsung galaxy s i90000 htc desire hd a9191 i've done aapt dump; here output: sdkversion:'4' uses-permission:'android.permission.internet' uses-permission:'android.permission.call_phone' uses-permission:'android.permission.receive_boot_completed' uses-feature:'android.hardware.telephony' uses-implied-feature:'android.hardware.telephony','requested telephony-related permission or feature' uses-feature:'android.hardware.touchscreen' uses-implied-feature:'android.hardware.touchscreen','assumed require touch screen unless explicitly made optional' uses-feature:'android.hardware.screen.portrait' uses-implied-feature:'android.hardware.screen.portrait','one or more activities have specified portrait orientation' main other-activities other-receivers other-services supports-scre...

php - What's the error with my code? -

i'm using smarty template , php. following code being written in smarty template. {literal} <script type="text/javascript"> // function gets test when category checkbox checked function get_subjects_by_class(class_id) { var field_id = 'subjects'; $.ajax({ url: "teacher_details.php", type: "get", data: { 'request_type': 'ajax', 'op': 'get_assigned_subject_list', 'class_id': class_id }, success: function (data) { $('#category_test_container').append(data); }); } </script> {/literal} call function follows : <a href="#" onclick="get_subjects_by_class({$class.class_id}); return false;">{$class.class_name}</a> upon clicking on hyperlink i'm getting error follows : referenceerror: $ not defined $.ajax({ i googled error resolution, c...

r - save data, code together? -

i reading in file in spss format (.por), cleaning in r , exporting clean .csv file. possible save code using read/clean/export data save along data? in other words, want able load datafile @ later point , able recall how created. if want console, here's hack: foo<-attributes(myfunc)$srcref write.table(as.character(foo),'myfunc.txt') edit: answer paul's question, here's output 1 of 'toys' . elements of each row (one element per pair of quotation marks) tab-separated. "x" "1" "function(x, numdig=3, na.rm=true,printit=true)" "2" "{" "3" " x<-as.vector(x)" "4" " if (na.rm) x <- x[!is.na(x)]" "5" " skewx<-theskew(x)" "6" " kurtosisx<-thekurt(x)" "7" " #allstats<-list(min=min(x), max=max(x), mean=mean(x), median=median(x),sdev=sd(x), skew=theskew(x), kurtosis=thekurt(x))...

PHP Get value from database into selectbox -

i have problem show database values select box. here code <select name="bugsolver"> <?php if(count($yourbugs) > 0) { foreach( $emails $key=> $singleemail) { ?> <option value="<?=$singleemail['email']?>" selected='selected'> <?php echo $singleemail['email']?></option>"; <?php } } ?> </select> your code should this: <select name="bugsolver"> <?php if(count($yourbugs) > 0): foreach( $emails $key=> $singleemail ): ?> <option value="<?php echo $singleemail['email']; ?>"> <?php echo $singleemail['email']; ?> </option> <?php endforeach; endif; ?> </select> when code easy read (at least you) it's easier find bugs. if above code still doesn't work, var_dump($yourbugs) , var_dump($emails) check if these values set. ...

javascript - Add two textbox values and display the sum in a third textbox automatically -

i have assigned task add 2 textbox values.i want result of addition appear in 3rd textbox,as enter values in first 2 textboxes,without pressing buttons. for eg:in first textbox want enter 450,when press digit 4 of number '450',then added 3rd textbox,any number press in first 2 textboxes,suddenly changes reflected on third textbox.how can this? here write code call sum() in onkeyup onkeyup="sum()" function sum() { var txtfirstnumbervalue = document.getelementbyid('txt1').value; var txtsecondnumbervalue = document.getelementbyid('txt2').value; var result = parseint(txtfirstnumbervalue) + parseint(txtsecondnumbervalue); if(!isnan(result)){ document.getelementbyid('txt3').value = result; } } this not working in chrome try this function sum() { var txtfirstnumbervalue = document.getelementbyid('txt1').value; var txtsecondnumbervalue = document.geteleme...

javascript - not able to access global variable while using google maps api js -

in below code, not able access value of variable distances . think because of asynchronous call directionsservice.route . how can value variable distances ? var totaldistance; var distances = new array(); var directionsdisplay; var directionsservice = new google.maps.directionsservice(); var map; var start = "abc xyz"; var end ; var points = new array("location abc", "location pqr", "location xyz", "location more", "and other location"); function initialize() { directionsdisplay = new google.maps.directionsrenderer(); var mapoptions = { center: new google.maps.latlng(13.0604220, 80.2495830), zoom: 10, maptypeid: google.maps.maptypeid.roadmap, draggablecursor: "crosshair" }; map = new google.maps.map(document.getelementbyid("map-canvas"), mapoptions); directionsdisplay.setmap(map); } function calcroute() { for(var j=0;j...

java - Scrollbars in JScrollPane don't refresh -

i have jpanel in jscrollpane. when jpanel changes (in case, draw image inside), scroll bars not refreshing accordingly. need move them sligthly or resize whole frame , fine. how force jscrollpane show correct scroll bars (ie. after loading picture)? you should include these methods when want modify jscrollpane according changes: jscrollpane.setviewportview(this); jscrollpane.revalidate(); jscrollpane.repaint();

php - A script to update all columns in a mysql database -

hi using php manipulate information in mysql database. looking way update table (all records need updated) based on information within table. for example have list of products lets 10 each unique id stored in products table. have purchases table has same product id , amount of purchases done each product. want update each product in products table reflect total purchases made each product , store in column called instock part of products table. how can done? if understand situation correctly, you're dealing stock-count. when item purchased (represented entry in products table) stock count figure should decreased. should happen within same transaction new entry products table keep data consistent. recommend using trigger on table implement this. you'll find lots of information implementing triggers in mysql on site. trigger use might this: create trigger update_stock_count before insert on purchases each row begin update products set st...

Facebook Share Feed Dialog only working for Admins -

after creating facebook app, leaving in sandbox , attempting setup share button using feed dialog, seems fb accounts i've added admins able use share button - other non-admins able see feed dialog popup, seeing "an error occurred, please try again.". i thought browser specific issue seems dependant on fb accounts relationship app. person non-admin has been testing app , unable share @ all. i using wordpress cms backend app. far can tell app id , app url correct, difference being on dev environment moved clients production fb page once working. i find bizarre works excellent provided admin of page. possible sandbox thing? i checked trying use share button when logged in page opposed issue, , not (if wondering). i believe using sdk/api , feed dialog correctly, code reference: header.php <div id="fb-root"></div> <script src="https://connect.facebook.net/en_us/all.js"></script> <script type="text/javascript...

MS SQL Server '08 ignoring username and password when requesting a connection with connection string using Integrated security=SSPI -

i'm using connection string connect ms sql server '08 db, "data source=qwe;initial catalog=dsa;integrated security=sspi;user id=mydom\unamee;password=pwd;" but server ignoring username specify , uses machine name instead; , says unable authenticate user mydom\mymachinename i've check other similar question, not same problem, please help, head breaking when use integrated security=sspi (or true ), userid , password have specified ignored. login made using windows credentials logged in windows\domain. in case you'll need have appropriate windows login created in sql server. if want use sql server login, specifying username , password created in sql server -you should set ' integrated security=false or remove property altogether because false default value. edit: to make long story short: can either use integrated security or username/password , not both. can not log in using else's domain account, of user logged in windows ...

iphone - how can i detect date from UITextView and add an event as you tap it -

can detect date uitextview , add event tap it. text view not in editable mode. tried self.txtview.datadetectortypes = uidatadetectortypeall; but not working please me you can add uitapgesturerecogniser in way.. - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. uitapgesturerecognizer *singletap = [[uitapgesturerecognizer alloc] initwithtarget: self action:@selector(dosingletap)]; singletap.numberoftapsrequired = 1; [self.txtview addgesturerecognizer:singletap]; } -(void)dosingletap:(uitapgesturerecognizer *)recognizer { // ----- here........ }

Local and production configuration files in Maven Project -

i'm starting out maven , have question regarding selecting resources deployment. have local , production properties directory, , when deploy want have 1 of them selected , put in appropriate place. project structure this - | -/src | | -/main | | | -/java | | | -/resources | | | -/webapp | | | | -/web-inf | -/config | | -/local | | | -/properties | | | | -config.properties | | -/prod | | | -/properties | | | | -config.properties | -/web-inf so when deploy should select appropriate properties folder , put /web-inf/ . how can achieve that? on side note, related, should config directory inside src/main/resources ? you can thing following (which have already): . |-- pom.xml `-- src |-- main | |-- java | |-- resources | |-- environment | | |-- test | | | `-- database.properties | | |-- qa | | | `-- database.properties | | `-- production | | `-- database.properties ...