Posts

Showing posts from April, 2014

read write - Take lines from two files, output into same line- python -

read write - Take lines from two files, output into same line- python - i pretty new python , attempting open 2 files take first line in first file, write out file, take first line in sec file , append same line in output file, separated tab. i've attempted code this, , outfile ends beingness whole contents of first file, followed entire contents of sec file. included print statements because wanted see going on in terminal while script running, why there. ideas? import sys infilename = sys.argv[1] infile = open(infilename, 'r') infilename2 = sys.argv[2] infile2 = open(infilename2, 'r') outfilename = "combined_data.txt" outfile = open(outfilename, 'a') line in infile: outfile.write(str(line) + '\t') print line line2 in infile2: outfile.write(str(line2) + '\n') print line infile.close() infile2.close() outfile.close() thank you! you can utilize zip this: with open(fi...

javascript - How to prevent a save without having cropped an image with imgAreaSelect -

javascript - How to prevent a save without having cropped an image with imgAreaSelect - i'm using imgareaselect plugin allow users crop image. prevent user hits save button without having cropped image. i'm looking solutation in javascript instead of checking server side if image has been cropped. from samples in imgareaselect api: $('img#photo').imgareaselect({ onselectend: function (img, selection) { alert('width: ' + selection.width + '; height: ' + selection.height); } }); just check if selection.width , selection.height > 0 javascript jquery

odbc - How to find the cause for the error: Provider error '8000ffff' Catastrophic failure DB2 V10 -

odbc - How to find the cause for the error: Provider error '8000ffff' Catastrophic failure DB2 V10 - somebody can help me find cause error: provider error '8000ffff' catastrophic failure in db2 server version 10.1.0.2? the asp code showed below works fine db2 connect version 9.7.2: connectstr = "driver={ibm db2 odbc driver};database=dbxx;uid=myuser;pwd=pypass;hostname=localhost;port=50000;protocol=tcpip;" set con0 = createobject( "adodb.connection" ) con0.open connectstr set rs = createobject( "adodb.recordset" ) rs.activeconnection = con0 rs.open "select * sysibm.sysdummy1", con0 response.write(now & " --->>>" & rs(0)) con0.close() set rs = nil set con0 = nil after installing new driver of db2connect 10.1.0.2 server error starts happen. our environment is: - windows server 2003 r2 32 bits running in vmware - mdac 2.8 sp2 - oledb32.dll 2.82.3959.0 any suggestion apreciated. after ...

javascript - jQuery form validation issue, other box when visible -

javascript - jQuery form validation issue, other box when visible - i have below 'other' box. want validate box not blank when visible. should straightforward having trouble. help much appreciated. thanks else if($('#mybox_' + id + ':visible')) { if(!blank('otherprodtypebox[<xsl:value-of select="@id"/>]')){alert("please come in valid other option");return false;} } <script type="text/javascript"> function myotherbox(e, id) { if (e.value == 'otherprodtype') { $('#mybox_' + id).show(); } else { $('#mybox_' + id).hide(); } } </script> <tr style="display:none;"> <xsl:attribute name="id">mybox_<xsl:value-of select="@id"/></xsl:attribute> <td class="label">other</td> <td> <input class="amdinputtext" type="te...

printing - Print (generate) a code128 barcode (or any image) in millimeters (php) -

printing - Print (generate) a code128 barcode (or any image) in millimeters (php) - i need generate labels code128 barcodes in php . these printed users printer. i have specific sets of requirements: narrow bar width should between 0.375mm , 0.5mm maximum overall barcode width: 115mm first 8 digits must utilize subset b remaining 20 digits must utilize subset c code must readable @ high speeds i tried several barcode libraries of them don't allow stating minimum bar width in millimeters. able scale narrow bar width in fixed integer increments, , 1 little , 2 big :) i tried resampling image using gd lib, code becomes unreadable @ high speeds. should build own code generator? if so, how generate bars in millimeters? thanks in advance ok, believe found solution applies not every browser , printer combination, suits me nicely. i using barodegen php library found @ barcodegen because 1 allowing me specify subset characters , 1 others. in specific prob...

azure - [AzureDirectory]Lucene.NET indexes get corrupted when we restart webrole -

azure - [AzureDirectory]Lucene.NET indexes get corrupted when we restart webrole - we using lucene.net in our project , using through azuredirectory library (https://azuredirectory.codeplex.com/) we have single webrole , single worker role. index created , updated via worker role thread. search webrole creating indexsearcher. issue facing - when upgrade cspkg using management console upgrade bits on prodn server, lucene index that's been created stops working. error like: file _2c.fdt not found (filenotfoundexception) at lucene.net.index.segmentinfos.findsegmentsfile.run() in c:\dev\code\lucene.net\index\segmentinfos.cs:line 741 @ lucene.net.index.directoryindexreader.open(directory directory, boolean closedirectory, indexdeletionpolicy deletionpolicy) in c:\dev\code\lucene.net\index\directoryindexreader.cs:line 140 @ lucene.net.index.indexreader.open(directory directory, boolean closedirectory, indexdeletionpolicy deletionpolicy) in c:\dev\code\lucene.net\index\in...

wpf - UserControl accessing DependencyProperty via RelativeSource Self -

wpf - UserControl accessing DependencyProperty via RelativeSource Self - i have been having problem using relativesource self in usercontrol. have contructed 2 usercontrols thought identical in operation, 1 works , other doesn't. user controls consist of label content want set dependencyproperty title of control. when set datacontext of usercontrol relativesource self, , bind label path=title works fine. if bind label relativesource findancestor, ancestortype{x:type usercontrol}}, path=title fails targetinvocationexception. any thoughts on doing wrong. this xaml of usercontrol works: <usercontrol x:class="usercontrolbinding.controls.mylabelcontrol1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.mic...

javascript - Why my request returns back only JSON, my page lose -

javascript - Why my request returns back only JSON, my page lose - when edit product, client side validation works. want check server side validation. used next code other objects. worked. utilize same code in product edit page. not work: jquery(document).ready(function () { ... if (jquery('#producteditform').validationengine('validate')) { jquery.post('/product/edit', { productid: jquery('#productid').val(), price: jquery('#price').val(), name: jquery('#name').val(), formname: 'product_edit_form', formtype: 'producteditf' }, function (result) { if (!result.success) { alert(result.error); } }); homecoming false; } else { homecoming false;...

How can I force Ant to ignore blank lines when using tokens->file -

How can I force Ant to ignore blank lines when using tokens->file - how can forcefulness ant ignore blank lines when reading files using tokens->file? to more precise: scripts.cfg ${dir.config} might contain lines file same name ./config/ folder. i'm using script determine whether lines/strings of 1 file exist in other one. however: in case content of 1 file not exist in other, there shouldn't differences. nevertheless though ${ant.refid:to_be_removed.list} returns number of differences, due 1 of files (the input.list one) containing blank lines - , mark differences whatever reason. i've tried using loadfile , tokenfilter, haven't been successful. way manages remove right lines (see code i've commented out @ end), removes blank lines, making file harder read. furthermore wanted able determine whether files have merged (= line count) using conditions along resourcecount-result. sadly resourcecount-id not 0, though there no differences blank lines...

regex - part of a regular expression not matching in javascript -

regex - part of a regular expression not matching in javascript - i posted in question think seperate , made another. the replace method has regular expressions in it. expressions match correctly , replace. replace(/\(he\/\she\)/g,"he") , replace(/\(he\/\she\)/g,"she") dont replace... dont know why. here code. function replacegender(name, gender, comment) { if(gender == "m") { comment = comment.replace(/\(name\)/g, name).replace(/\(he\/she\)/g,"he").replace(/\(his\/\her\)/g,"his").replace(/\(his\/\her\)/g,"his").replace(/\(he\/\she\)/g,"he").replace(/\(him\/\her\)/g,"him"); } else if(gender == "f") { comment = comment.replace(/\(name\)/g, name).replace(/\(he\/she\)/g,"she").replace(/\(his\/\her\)/g,"her").replace(/\(his\/\her\)/g,"her").replace(/\(he\/\she\)/g,"she").replace(/\(him\/\her\)/g,"her"); } homec...

version control - Git rebase: finding the "next" commit to be rebased? -

version control - Git rebase: finding the "next" commit to be rebased? - we have 2 branches in git, master , develop . master beingness updated partner group, , rebasing our develop branch onto master , this: #(on develop) $ git pull --rebase origin master #1 $ git rebase origin/develop #2 $ git force origin develop #3 …but yesterday partner grouping committed onto master without proper e-mail address, , encounter problem step #2 : git rebase origin/develop first, rewinding head replay work on top of it... applying: <...> <...> patch not have valid e-mail address. and git status shows: $ git status # not on branch. # rebasing. # (all conflicts fixed: run "git rebase --continue") # nil commit, working directory clean what have done skip commits without address git rebase --skip , cherry-pick these commits after rebase. wonder proper way it? can cherry-pick commit in question straight in-place, without skip...

wpftoolkit - how to bind an autocompletebox with a model in mvvm? -

wpftoolkit - how to bind an autocompletebox with a model in mvvm? - i exposed collection , binded itemsource of autocompletebox works selecting or changing text on autocompletebox doesn't update model textbox or label! viewmodel: public observablecollection<string> symptomsdb { get; private set; } private string symptom; public string symptom { { homecoming symptom; } set { symptom = value; raisepropertychanged(() => this.symptom); } } public analysisviewmodel() { list<string> s = new list<string>(); s.add("test"); symptomsdb = new observablecollection<string>(s); } view: <controls:autocompletebox itemssource="{binding symptomsdb}" selecteditem="{binding symptom}" text="{binding symptom}" istextcompletionenabled="true" filtermode="contains"/> to alter user interface viewmodel, need bind propert...

join - Need help to make one mysql query to get expected result for my requirement -

join - Need help to make one mysql query to get expected result for my requirement - i facing few issue write mysql query in scope result. getting appropriate result using existing query not written appropriate way. here query: select c.id, c.chn_name,c.chn_logo, (select id tv_showtime showtime<='2013-02-18 10:28:35' , status='enable' , chn_id=c.id order id desc limit 0,1) currentshowid, (select tv_showtime tv_showtime showtime<='2013-02-18 10:28:35' , status='enable' , chn_id=c.id order id desc limit 0,1) currentshowtime , (select tv_showtime tv_showtime showtime >'2013-02-18 10:28:35' , status='enable' , chn_id=c.id order id asc limit 0,1) nextshowtime tv_channels c c.status="enable" order c.chn_name limit 0,10 here, there 2 tables named "tv_channels" , "tv_showtime". need 1 record each channel @ time ( current time). here suppose 12 channels , app...

github - Git: Recover the deleted remote branch -

github - Git: Recover the deleted remote branch - well, i've made terrible error first want delete remote connection repositories. i've made command this: git force dev :test which after check on github, i'm realize branch test deleted. question: how can branch back? possible undo command i've made? do still have local re-create you? run git branch check, still have local branch there since don't mention removing local branch. if this case, force remote repository again, git force dev test without colon. git github

sql - points within a particular distance -

sql - points within a particular distance - i have table conatining set of points. create query checks distance between points , if distance little er tolerance set points one. any suggestions how can accomplish such task? the next graphical issue of have. want 1 point exist 3 distinct roads meet this tricky issue more 1 way prepare it. one obvious strategy seek , find unique points snapped virtual grid, using st_snaptogrid. technique works best projected units (e.g., metres utm), not geographic coordinates (with degrees of latitude/longitude), have variable physical distances. sql postgresql geospatial postgis spatial-query

Android Custom notification with setOnClickPendingIntent doesn't work on lower version than 3.0. Is there a work around to make it work? -

Android Custom notification with setOnClickPendingIntent doesn't work on lower version than 3.0. Is there a work around to make it work? - i'm playing notification not able create notification custom layout works on froyo (or other android version lower 3.0) works on ics. the problem want associate pending intent single views. in sentiment there work around because app notification toggles don't know how. please help me. regards i'm playing notification not able create notification custom layout works on froyo (or other android version lower 3.0) works on ics. you can create custom layouts on previous versions, cannot respond click events reliably. the problem want associate pending intent single views. that not supported prior rich notifications added in android 4.1. may work on devices, due manufacturer modifications, not work devices. in sentiment there work around because app notification toggles don't know how "n...

website - Abount DNS configuration in CPanel, Please help me -

website - Abount DNS configuration in CPanel, Please help me - i want inquire cpanel, have asked customer, used cpanel website command panel, case this. my client have cpanel whm, domain's name myclient.com can controled cpanel, have 1 exsisting website hosting @ www.existingmyclient.com, want create subdomain illustration oldsite.myclient.com, display content of www.existingmyclient.com, so, must configure in cpanel purpose ? go parked domains on cpanel of business relationship existingmyclient.com create parked domain oldsite.myclient.com this parked subdomain (or domain) point existingmyclient.com website dns subdomain cpanel

python - How to add own form field to instance from models form? -

python - How to add own form field to instance from models form? - if request.method == 'post': try: form = exampleform(request.post, instance=example.objects.get(user=request.user)) except: form = exampleform(request.post) if form.is_valid(): m = form.save(commit=false) is_ok = request.post.get('is_ok') m.is_ok = is_ok m.user = request.user m.save() how add together field is_ok instance=example.objects.get(user=request.user) note: can not add together field model forms. if alter existing data, is_ok value changes default edit: <input type="checkbox" disabled="disabled" checked="checked" name="is_ok" id="id_is_ok"/> if input disabled, is_ok = request.post.get('is_ok') = none you should in declaration of exampleform class. assume class looks from your_app.models import examp...

php - Dynamically Styling an FOS UserBundle Login Page -

php - Dynamically Styling an FOS UserBundle Login Page - i relatively new symfony 2 have site many different sub domains , user areas login page styled differently, not. using symfony 2 , fos userbundle , working 1 firewall in security.yml. overriding fos userbundle layout per documentation, able style page differently depending on request coming from, example: microsite1.mainsite.com/user gets style microsite1.mainsite.com/admin gets style b microsite2.mainsite.come/user gets style c i have considered few options , i'm looking other opinions. first alternative had considered overriding/extending controllers in fos userbundle referrer identified , different twig template rendered. alternative utilize different firewall different routes, want able have users in different microsites authenticated across sites 1 firewall preferred. there other solutions this, or there 1 way more preferable tackle relatively minor issue? you can override renderlogin m...

recurring billing - Multiple cancel links do not redirect properly in drupal -

recurring billing - Multiple cancel links do not redirect properly in drupal - if user clicks "update" link in recurring fees table, decides not create changes , clicks cancel instead of update, access denied because cancel link redirects admin view of recurring fees, not user view. authorize.net handler, url in question following: example.com/user/263/recurring/715/cancel/authorizenet_cim?destination=user/263/recurring-fees this code got when doing research, changed code according mentioned below,but does't work me help! in uc_recurring.uc_authorizenet.inc around lines 140-147: $form['submit'] = array( '#type' => 'submit', '#value' => t('update'), // '#suffix' => l(t('cancel'), 'admin/store/orders/recurring/view/fee/' . $rfid), '#suffix' => l(t('cancel'), $_server['http_referer']), //this line have added ); it easy, can add together rules, redirect...

c# - Is it possible to get Group Notes from Active Directory? -

c# - Is it possible to get Group Notes from Active Directory? - active directory groups have 'notes' property available through interface (see image below) is possible retrieve info in c#? i can't seem find property holds it. i've tried using system.directoryservices.directoryentry , system.directoryservices.accountmanagement.groupprincipal objects none of them seem have it. there property called info holds info shown within field. added advertisement object if value available. if see elements have text within field. open advertisement browser ( start dsa.msc ) , open new search. alter selection within "find" combobox custom search , click on advanced , come in text info=* . you'll list of elements having field. c# active-directory directoryservices

How to Update drupal 7.17 from drupal 7.17 into 7.18 -

How to Update drupal 7.17 from drupal 7.17 into 7.18 - how upgrade lower version 7.18 version. have got 'a script on page may busy, or may have stopped responding. can stop script now, or can go on see if script complete. script: modules/contrib/jquery_update/replace/jquery /1.5/jquery.min.js?v=1.5.2:16' thanks maybe should deactivate jquery update module while updating drupal? here standard way minor upgrade(7.17 -> 7.18). put site in maintenance mode. backup files ftp. backup database. download new drupal version , uncompress. check current drupal installation stuff dont wanna replace(sites , profiles). delete old core files/dirs , upload new core files ftp without replacing sites , double check wont delete profile in profiles dir. run update.php update contrib modules(one one) , run update.php, if break have chance find problem. drupal drupal-7

android - How can I set the style of the EditText.setError() icon to the ones used in the default style while using a different theme? -

android - How can I set the style of the EditText.setError() icon to the ones used in the default style while using a different theme? - when seterror on edittext in activity has no theme set, shows nice dialog error text in it. how can set style when using different theme activity holo.light ? android styles themes

WordPress: cPanel password protect wp-admin generates too many redirects -

WordPress: cPanel password protect wp-admin generates too many redirects - i'm trying utilize built-in password protect alternative of cpanel protect wp-admin/ directory. problem when create rule , associate user newly created user, generates infine redirect sequence on directory. maybe it's because i'm logged in, i'm not sure. don't know how works in wp, since started writing articles smashing mag know possible because utilize same feature on backend site. help appreciated. thanks. wordpress passwords cpanel

javascript - Change the colors of a cube's faces -

javascript - Change the colors of a cube's faces - i found this question, says material.color doesn't exist. need know how alter colors of various faces of cube i'm drawing: var newcube = new three.mesh(new three.cubegeometry(size, size, size), new three.meshnormalmaterial({ vertexcolors: three.facecolors })); here how set , alter colors of cube's faces: var geometry = new three.boxgeometry( size, size, size ); ( var = 0; < geometry.faces.length; ++ ) { geometry.faces[ ].color.sethex( math.random() * 0xffffff ); } var material = new three.meshbasicmaterial( { color: 0xffffff, vertexcolors: three.facecolors } ); if geometry.faces[i].color changed, set geometry.colorsneedupdate = true . ( not required canvasrenderer . ) three.js r.71 javascript colors three.js mesh face

Activating the root user with a python script. (OSX) -

Activating the root user with a python script. (OSX) - okay, i've been working on pythonbased 'hacktool' helps penetration testers install basic tools on mac. of these tools require root user activated, need easy way activate root user (on mac can done 'passwd root' sadly requires input typed) need help here guys, running low on time , net won't give me helpful answers. :s there command in osx called 'dsenableroot' did wanted do. command works this: dsenableroot -u yourusername -p yourpassword -r rootpassword it supposed do, need workaround on 'yourpassword' part, since don't know password of users computer. post updates here! python osx user root

c++ - cv::Mat frame and SCILAB -

c++ - cv::Mat frame and SCILAB - i have frame in opencv wich don't want save using imwrite(), utilize code extract each channel , save , open 3 files , combining new frame first here c++ code : ......... mean_fb.open("d:\\mean_blue",ios::out); ostream osb(&mean_fb); mean_fg.open("d:\\mean_green",ios::out); ostream osg(&mean_fg); mean_fr.open("d:\\mean_red",ios::out); ostream osr(&mean_fr); resultframe *= 1.0/255.0; // adjusting colors of mean value for(int row = 0; row < resultframe.rows; row++) { (int col = 0; col < resultframe.cols; col++) { // std::cout << resultframe.at<cv::vec3f>(row, col)[1] <<std::endl; std::cout << resultframe.at<cv::vec3f>(row, col)[2] <<std::endl; //fwrite(&resultframe.at<cv::vec3f>(row,col )[0],sizeof(float),1,inpr); osr<< resultframe.at<cv::vec3f>(row, col)[0]<<"\n"; osg<...

SharePoint 2013 Apps to Apps Communication -

SharePoint 2013 Apps to Apps Communication - i having requirement have 2 apps[client app parts]. user trying drag items app1 app2, app2 action. functionality available in sp 2013. have added 2 sp 2013 document library apps. sp 2013 not allowed drag item app1 app2, allowed drag item app1 app2[which listed in recent items]. i'm aware app-2-app communication not possible in sp 2013. anyway implement scenario in sp 2013? sharepoint sharepoint-2013

c# are these parameters passed to c++ dll function correct? -

c# are these parameters passed to c++ dll function correct? - hi have 3rd part dll functions create request dvr...i tried functions got wrong results...i don't know if i'm wrong or dll have problems.. dll docs: int winapi tvcc_get_rec_days(int server_handle,struct photographic camera *video_camera,char **days,int *size); char **days should not allocated character pointers array contain days list int *size length of array i declared function in c# [dllimport(lib, entrypoint = "@tvcc_get_rec_days$qqsip6camerappcpi")] static public extern int tvcc_get_rec_days(int server_handle,ref photographic camera video_camera,ref char*[] days,ref int size); now if phone call function this: static char*[] days; static int size; int returnvalue = gamssdk.tvcc_get_rec_days(sh2,ref cameras[1],ref days,ref size); i right homecoming value (function works good), size 104 days not 104 array!! days.length = 1 if seek read first cell null exception...i trie...

shell - Space separated arguments in bash -

shell - Space separated arguments in bash - #!/bin/bash ret=`zenity --entry ` zenity --entry --text=$ret here sec instruction prints first word of string. how take string can contain white spaces ?? with this: zenity --entry "--text=$ret" that should nowadays entire --text=thing spaces in it single argument. of course, zenity executable must still able handle arguments spaces in them different issue. by way of example, see next script executable: #!/bin/bash echo "[$1]" "[$2]" when run without , quotes, next results: pax> ./testprog.sh 2 args [two] [args] pax> ./testprog.sh "one arg" [one arg] [] bash shell

sql - calculating Product Cost Price in runtime -

sql - calculating Product Cost Price in runtime - i developing inventory system, using average cost method, average cost cost of product changes on each new purchase. database using sql server 2008 now need calculate cost of goods sold in report, have add together cost cost each sale of product, cost cost should relevant specific purchase period. my purchase table purchase_date product_id ave_cost_price 1-jan-2013 1 5.5 15-jan-2013 1 6.5 30-jan-2013 1 7.5 my sales table sale_date product_id sale_price cost_price 5-jan-2013 1 10 ? sale-1 17-jan-2013 1 10 ? sale-1 31-jan-2013 1 15 ? sale-1 now when create sale report, sale-1 should take 5.5, sale-2, 6.5 , sale-3 should pick 7.5 product cost price. , if cannot find purchase should pick opening cost_price product_table. i looking such query sh...

Resolving "undefined reference" compilation errors of Boost C++ code in Ubuntu -

Resolving "undefined reference" compilation errors of Boost C++ code in Ubuntu - this question has reply here: undefined reference boost::system::system_category() when compiling 6 answers from terminal session: go trojans >make g++ -static -i/usr/include/boost -i/usr/include/boost/filesystem get_sys_info.cpp /tmp/cc6nk9ev.o: in function `__static_initialization_and_destruction_0(int, int)': get_sys_info.cpp:(.text+0x13a): undefined reference `boost::system::generic_category()' get_sys_info.cpp:(.text+0x146): undefined reference `boost::system::generic_category()' get_sys_info.cpp:(.text+0x152): undefined reference `boost::system::system_category()' collect2: ld returned 1 exit status make: *** [all] error 1 go trojans > the c++ code importing boost c++ filesystem library: #include <iostream> #include <string> #includ...

Need assistance with C++ function to parse/display XML serialization -

Need assistance with C++ function to parse/display XML serialization - i need help getting xml serialization work properly. right have 2 functions read xml file, char char. right observe , store elements storing content of elements variable. have function print hierarchy of elements , show contents contain. my problem: can't function correctly identify end tag elements! example, when parsing gets elements end tag, detects element rather end of element. sorry text , length of code. i'm trying thorough possible. in advanced! this displayed when code compiled , ran. notice hot there elements equal nothing: xml.world.item.name = silver key xml.world.item.properties.property = metal xml.world.item.properties.property = silver xml.world.item.properties = xml.world.item.weight = 1 xml.world.item.displaychar = ) xml.world.item.value = 10 xml.world.item.rarity = 5 xml.world.item = xml.world.creature.name = orc xml.world.creature.properties.property = orcish xml.world.cr...

android - Sometime Not Receiving push notification GCM in Mobile -

android - Sometime Not Receiving push notification GCM in Mobile - i facing unusual problem. getting force notification in mobile, if connected net @ point when message has been send server side. if not connected net @ time , rather connecting net after time. not receiving notification. according knowledge notifications should show whenever online, because gcm server stores messages. receiving notification other apps. have given wakelock permission in manifest. might problem? server side, client side or mobile? please help... this value send gcm server 3rd party server(.net server): string postdata= "collapse_key=score_update&time_to_live=2419200&delay_while_idle=1&data.message=‌​" + message + "&data.time=" + system.datetime.now.tostring() + "&registration_id=" + devicetoken + "" thanks in advance delay_while_idle=1 contradicts also have given wakelock permission in manifest delay_while_idle=1 mea...

excel - Copy value of cell to another cell to record vehicle mileage -

excel - Copy value of cell to another cell to record vehicle mileage - i'm working on spreadsheet record vehicle mileage. i'd manually come in starting mileage in f6 , ending mileage in g6. i'd value of g6 automatically copied f7 , i'd come in ending mileage in g7- , on. problem have dealing weekends , holidays when 2 or 3 blank cells may occur. i've tried using =if(d9=""," ", g6) , doesn't work. i've tried function in vba: =if(d9=""," ",lastnonblankcell(g8:g39)) [d9 datefield] , ended 0's. function lastnonblankcell(range excel.range) variant application.volatile lastnonblankcell = range.end(xldown).value end function do need blank rows weekends or holidays? if not, set d8 formula =workday.intl(d7,1) re-create downwards far needed. if need allow holidays, see excel documentation workday.intl . list of dates contain workdays, ending mileage 1 row can copied downwards next no ...

SQL: How to create result as shown below -

SQL: How to create result as shown below - i facing issue below case: i/p table: column_1 column_2 b b c c d d cross bring together give me below result actual o/p value: aa ab--this combinati on repeated ac advertisement ba--this combination repeated bb bc bd ca cb cc cd da db dc dd expected op: aa ab ac advertisement bb bc bd cc cd dd i dont want combinations repeated: ab , ba. add status requiring sec value greater or equal first: .... (column_2 >= column_1) sql

jquery - Handling copyright symbol in javascript variable coming from MVC3 -

jquery - Handling copyright symbol in javascript variable coming from MVC3 - i have jquery dialog multi tab layout, each tab partial view returned mvc3 web application called using jquery ajax. final tab simple overview of info entered on previous tabs review screen before user marks info finish clicking button. when model returned controller view map several server side model variables variables in javascript during document.ready jquery function. these variables later used build query string passed server upon click of confirm button. i erors when 1 or more of these variables contains copyright symbol (©). when set javascript variables calling encodeuricomponent javascript method (as using these variables in query string). don't know or how many variables contain copyright symbol. when set variables on client side copyright symbol set "©", can seen when calling alert , variable name. problem calling encodeuricomponent on gives result not right , causes jq...

ruby - Isn't user data that comes in from a form in Rails going to be UTF-8 encoded? -

ruby - Isn't user data that comes in from a form in Rails going to be UTF-8 encoded? - a rails 3.2 app i'm contributing has method coerces user input utf-8. require "iconv" def normalize(user_input_text) iconv.new('utf-8//ignore', 'utf-8').iconv(user_input_text.dup) end it encodes string in utf-8 , ignores characters can't transcoded. but isn't user info that's entering rails through form going utf-8 encoded? in other words, isn't code specious , unnecessary? these resources suggest indeed right. now vast bulk of web input utf-8, set inbound parameters utf-8. eliminate many cases of incompatible encodings between ascii-8bit , utf-8. https://github.com/rails/rails/commit/25215d7285db10e2c04d903f251b791342e4dd6a rails 3 solves nicely doing number of things including interpreting params utf-8 , adding workarounds net explorer http://jasoncodes.com/posts/ruby19-rails2-encodings ...

Fire a callback when route is changed (animations, loaders etc) in AngularJS -

Fire a callback when route is changed (animations, loaders etc) in AngularJS - i rather new angularjs. when route changed, ng-view changes content. able do, hook on behavior when route changes. i able illustration animate view we're leaving (fading out, , sliding left) , when next view readily available, fade , slide view in. implemented adding class body on route loading, , removing class on route alter successfull i ability have views stacked on right of current view, when 1 moves forward, next view first loaded right of current one, viewport slides right current view slides out of view, , next 1 slides view (windows phone off canvas navigation) is $routeprovider right place this? are there gurus out there point me in right direction? after more research, there events fired purpose. $scope.$on('$routechangestart', function(scope, next, current){ //... }); $scope.$on('$routechangesuccess', function(scope, next, current){ //... });...

itunes - Restrict a wifi router to access a specific Android & iPhone app -

itunes - Restrict a wifi router to access a specific Android & iPhone app - what best solution have wifi connection give access 1 specific android & iphone app. used in shop allow customers download app without making possible utilize wifi connection other purpose. (another connection dedicated other uses) the best thing app pre-loaded in router download fastest possible. router have communicate itunes or google play understanding , statistics reasons. you have device booked in ap (access point). can't restrict single application (without policies on device, can't affect). making not possible utilize wifi connection other purposes matter of connect ap , how configure it. means don't connect network or net respectively setup firewall between networks. wifi itunes router

angularjs - Getting CSS from Angular element in custom directive using dynamic class name -

angularjs - Getting CSS from Angular element in custom directive using dynamic class name - i have custom directive makes utilize of background color of element in link function: .directive('ktmouseover', function($log) { homecoming { restrict: "ac", link: function(scope, elm, attrs) { if ($(".ie8, .ie7").length === 0) { console.log(elm.attr("class")); var oldbackgroundcolor = elm.css("background-color") || elm.css("background") , colors = attrs["ktmouseover"].split("|")[0] || "#fec|#f55" , timings = attrs["ktmouseover"].split("|")[1] || "75|150" , newbackgroundcolor = colors.split(":")[0] || "#fec" , newdangercolor = colors.split(":")[1] || "#f55" , fadeintime = parseint(timings.split(":")[0]) || 75 , fadeouttime = pars...

java - Sprite not moving on JPanel -

java - Sprite not moving on JPanel - i'm trying simple sprite moving around screen. can't head around wrong code i've followed instructions different source code removed complexity added other features in other code. right i'm trying move around freely on screen. later intend animation alter while moving. code both classes below. package game; import java.awt.graphics; import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.awt.event.keyadapter; import java.awt.event.keyevent; import javax.swing.jpanel; import javax.swing.timer: public class game extends jpanel implements actionlistener { int x, y, b_width, b_height; player player; timer timer; public game() { addkeylistener(new keyrecorder()); player = new player(); timer = new timer(5, this); timer.start(); } public void paint(graphics g){ g.drawimage(player.image, player.getx(), player.gety(), this); } @override public voi...

php - Mongo will not load in phpinfo with error_reporting enabled -

php - Mongo will not load in phpinfo with error_reporting enabled - i have been trying mongo work on php 5.3 apache2 on ubuntu server 12.04 several hours now. it giving error: fatal error: class 'mongoclient' not found in /var/www/projects/learn/create.php on line 7 mongo showing in php -m not in phpinfo() . after long search tried commenting next in php.ini : default value: e_all & ~e_notice this causes mongo appear in phpinfo() statement, , $m = new mongoclient() doesn't throw errors. problem need error reporting turned on (as new developer). what perchance causing mongo fail load when verbose error reporting enabled? edit: of possible note turned on error reporting in individual php file , shows errors properly, while still letting mongo load in probability mongo extension not installed on dev/server setup. first check whether installed. create file called phpinfo.php contents: run browser. search mongo. see version is. if not ...

c++ - Combining two 8-Bit array to a USHORT (16 Bit) , without loop -

c++ - Combining two 8-Bit array to a USHORT (16 Bit) , without loop - i need combine 2 uchar (8 bit) arrays ushort (16 bit) value in c. must without using "for" or loop. as: uchar a[1000], b[1000]; ushort c[1000]; result must as: c[0] = {a[0], b[0]}; c[1] = {a[1], b[1]}; ... c[1000]={a[1000], b[1000]}; uint8_t 1 = 0xba; uint8_t 2 = 0xbe; uint16_t both = 1 << 8 | two; update: maybe have not understood problem... if want convert uint8_t array uint16_t array-> check size , cast uint8_t array[100]; uint16_t array_ptr_ushort* =(uint16_t*)&array[0]; make sure size of array even. update2: uint8_t array1[100]; uint8_t array2[100]; uint16_t combined[100]; memcpy(combined, array1, sizeof(array1)) memcpy((uint8_t*)combined + sizeof(array1), array2, sizeof(array2)) update3: you can not combine 2 arrays in 1 contignous array without sort of loop, loop exist in underlying hardware utilize dma this... update4: you can recurs...

spring - How to pass request parameter to 'default-target-url' -

spring - How to pass request parameter to 'default-target-url' - i setting 'cat=1' in hidden field in login.jsp page , expecting available on default-target-url. entry in spring-security.xml is, <form-login login-page="/login.html" default-target-url="/index.html" authentication-failure-url="/loginfailed.html" /> and in controller, @requestmapping(value="/index", method = requestmethod.get) public string index(httpservletrequest request) { string cat = request.getparameter("cat"); if (cat != null && cat.equalsignorecase("1")) { homecoming "add"; } homecoming "redirect:/index.jsp"; } but cant request parameter value (cat null) believe because 'default-target-url' redirects request (and not forwards it?). case? if yes there way can pass parameter 'default-target-url'? i ...

objective c - does assistant editor in xcode 3.4.3 has an alternative? -

objective c - does assistant editor in xcode 3.4.3 has an alternative? - first, have xcode 3.4.3 installed on hackintosh(10.6.5). when started using xcode , follow apple's steps "your first mac app" tutorial. when walked through creating actions controls, inquire me utilize assistant editor create connections between command , logic code, can't find called assistant editor because using xcode 3.4.3? could please tell me alternatives. //edit: assistant editor seems nowadays @ xcode 4 , higher, tutorial using newer current xcode version. @popeye hint. the alternative add together connections yourself. have add together outlets in interface-file (h-file) , implemenations in implementation-file (m-file). there tutorial video fromon how accomplish this: xcode 3 recipes - connecting outlet old post: mentioned "assistant editor" neat way connect outlets code. connects gui code. illustration if have button on screen , want register touch ...

iphone - How to call Notification from another class -

iphone - How to call Notification from another class - i seek phone call notification class // in classa - (void)ondidfinishlaunchingnotification:(nsnotification*)notification { nslog(@"ondidfinishlaunchingnotification"); } calling notification class // in class b [[nsnotificationcenter defaultcenter]addobserver:nil selector:@selector(ondidfinishlaunchingnotification:) name:nil object:nil]; in class a, add together self observer of notification name [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(ondidfinishlaunchingnotification:) name:yourondidfinishlaunchingnotificationname object:nil]; and in class b, utilize -postnotificationname:object: post notification: [[nsnotificationcenter defaultcenter] postnotificationname:yourondidfinishlaunchingnotificationname ...

Python how to ensure that __del__() method of an object is called before the module dies? -

Python how to ensure that __del__() method of an object is called before the module dies? - earlier today asked this question __del__() method of object uses imported module. problem __del__() wants create utilize of module os , (not always) module has been deleted. told when python programme terminates, order in objects , modules deleted can random, , undefined. however, application, need create sure object (instance of class created) gets deleted before module (in object instantiated) gets deleted. there way of doing this? as told before, shouldn't rely on __del__ beingness called when interpreter exits. there 2 options doing properly: the first atexit import os class logger(object): def del(self): print "os: %s." % os logger = logger() atexit.register(logger.del) this makes sure logger gets finalized @ exit. *reading little more problem, since plan on having single instance bound module defines instances's class, c...

MySQL - Optimization select query -

MySQL - Optimization select query - my query taking 5 seconds finish sounds much basic. did explain query: https://www.dropbox.com/s/18pedm9n5fssz4e/localhost%20_%20localhost%20_%20logrede%20_%20phpmyadmin%203.4.11.pdf it possible help me optimize it? thanks :) i've restructured query using joins instead of less readable clause. see based on primary "material" table. so, first suggestion utilize "straight_join" clause tell mysql query in order have listed.... otherwise, tries think , things in alternate "primary" table driving query. other tables "lookup values" tables. secondly... on each of tables, have next indexes on tables. i'm sure had on primary keys of each table... since group_concat getting corresponding descriptive field table, include column in index. here's other reason... when query run , using index, if query not have go raw table "other" columns, doesn't have to. so, having d...

c# - Separate dll for class library -

c# - Separate dll for class library - i have class library multiple cs files, when build it, generates dll file reference in project. okay when alter 1 cs file, suppose have changes in multiple file wish particular alter in dll rather unnecessary cs files. as alternative we can create separate class library , hence separate dll every classes, lastly alternative guess use preprocessor directives like #define vc7 //... #if debug console.writeline("debug build"); #elif vc7 console.writeline("visual studio 7"); #endif but need have thing in designer too so best solution?? tfs (or other version command system) can this. set tfs build server , check in files ready compiled. there many ways set up. research. start reading on continuous build and/or continuous integration , read on how various version command systems implement that. c# .net

python - List of strings in string -

python - List of strings in string - how can write look in python checks if string contains of strings provided. this: s = 'winter summer spring fall' # fall , spring i_like = 'fall', 'spring' in s use built in any function: i_like = any(i in s in ('fall', 'spring')) this checks if of elements in tuple in string. python

Can a C# DLL call C++/CLI managed wrapper which calls native C++ static library? -

Can a C# DLL call C++/CLI managed wrapper which calls native C++ static library? - i have dll exception encountering: response threw exception: not load file or assembly or 1 of dependencies. effort made load programme wrong format. i have source code next dll/library combinations. trying figure if have unusual combination or need check ensure runs. have native c++ code in static library called managed c++ clr supported dll. seems work fine until next point. i created test c# exe console application phone call managed c++ clr supported dll. works expected. difference exception thrown when there c# class library calling same managed c++ clr supported dll. supported @ or reason why exception gets thrown? if combination incorrect, there workaround c# class dll phone call managed c++ clr supported dll. everything created windows 7 64 bit visual studio 2012. projects in release mode x64 bit platform selected. in every case i've seen, 32-bit c# app tryi...

php - preg_replace with optional matches -

php - preg_replace with optional matches - well.. creating blog myself , i've created preg_replace "posts" if type: [code="php"]foobar[!code] he prints <script type="syntaxhighlighter" class="brush: $1; html-script: true"><![cdata[ foobar ]]></script> everything runs ok preg_replace: /\[code="(.*?)"\]/ (for prefix) /\[!code\]/ (for sufix) but want add together additional alternative check if user has typed... thought that: [code="php" [1,3]] foo [!code] return this: <script type="syntaxhighlighter" class="brush: $1; highlight: [1,3]; html-script: true">... otherwise if have not $2 (user has typed [code="php"]) homecoming this: <script type="syntaxhighlighter" class="brush: $1; html-script: true"> how can create statement in same preg_replace? in advance , sry bad english. edit i've ac...

load balancing - Linux Scheduler on NUMA and SMP -

load balancing - Linux Scheduler on NUMA and SMP - i wanted know if re-create of schedule() function runs on each processor, or 1 schedule() running each processor. if there re-create of schedule() running on each processor/core, how processes dispatched particular cpu/cpu runqueue. job of load balancer? there 1 load balancer running cpu's or done in distributed fashion using flags/communication method? ps- know working of scheduling classes etc having hard time figuring out distribution of processes among various runqueues. how processes dispatched particular cpu/cpu runqueue. job of load balancer? yes. in multi-processor scheme load balancer periodically checks see whether cpu loads unbalanced; if are, processor performs cross-cpu balancing of tasks. is there 1 load balancer running cpu's or done in distributed fashion using flags/communication method? yes. in smp scheduling there 1 schedule() , 1 load balancing manage multitasking between mul...

else if issues java -

else if issues java - i have else if loop, loop searches through file extension see if matches, if not want print out message, have tried print , println, never prints out message, ideas doing wrong, apart loop working fine if (extension.equals("txt")) { psinformat = docflavor.input_stream.autosense; } else if (extension.equals("jpeg")) { psinformat = docflavor.input_stream.jpeg; } else if (extension.equals("png")) { psinformat = docflavor.input_stream.png; } else if (extension.equals("gif")) { psinformat = docflavor.input_stream.gif; } else if (extension.equals("pdf")) { psinformat = docflavor.input_stream.pdf; } else if (extension.equals("html")) { psinformat = docflavor.input_stream.text_html_host; } else { system.out.print ("sorry printer no back upwards file type, so...

php - bootstrap tabs not working -

php - bootstrap tabs not working - the bootstrap website not great job of explaining how tabs work. have looked @ few similiar questions here on stack havent been able prepare problem. here html code: <!doctype html> <html> <head> <meta charset="utf-8"> <title>90 min ipa</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="leopard - clean & responsive html template"> <!-- favicon & icons --> <link rel="icon" type="image/png" href="img/favicon.ico" /> <link rel="apple-touch-icon" href="img/apple-touch-icon.png"> <link rel="apple-touch-icon" sizes="72x72" href="img/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="114x114"...