Posts

Showing posts from August, 2013

windows 7 - Installing Git-TFS without Git itself -

currently, way install git-tfs bridge through chocolatey . when tried it, however, appears install git (for windows) along actual git-tfs package. have git installed on work machine, don't need modify/remove what's there. is there way force chocolatey not modify current git install , put in git-tfs package? if there is, how configure use current git install? i can't speak other git clients, if you're using git-bash shell, can download source git-tfs github, compile it, , put anywhere on system , add location path environment variable. shell find git-tfs , hook in.

javascript - Umbraco add linked from page @nodename as text input value on form -

how can add linked page @nodename text input value on form? input disabled, user cannot change text. <input type="text" name="jobtitle" id="jobtitle" value="job title prefilled here linked page @nodename - disabled field" disabled="disabled" /> i assume razor? try @model.name instead.

PHP form validation error -

hi beginner in programming php , while trying form validation got error: "fatal error: can't use function return value in write context in c:\xampp\htdocs\web\proiecte\cristina\formular.php on line 67" this html section: <form id ="fabrica" action="formular.php" method="post"> <input type="checkbox" name="unu"/> </form> and php code: if(isset($_post('unu'))){ echo "<tr>"; echo "<td>a mers</td>"; echo "</tr>"; } what doing wrong? _post associative array (a superglobal) you can access content using regular array syntax $_post['unu'] instead of $_post('unu')

iphone - post on multiple friends facebook wall -

i make application 1 facebook wall post. works me using fbconnect. want wall post multiple friends @ time on 1 button click. possible post on multiple friends wall? if possible suggest me. my code : nsmutabledictionary *params = [nsmutabledictionary dictionarywithobjectsandkeys: [nsstring stringwithformat:@"%@",[[arrdata objectatindex:i] objectforkey:@"id"]], @"to", @"post on facebook", @"name", @"facebook wall post", @"description", @"http://m.facebook.com/apps/myapp", @"link", nil]; appdelegate *delegate = (appdelegate *)[[uiapplication sharedapplication] delegate]; [[delegate facebook] dialog:@"feed" andparams:params anddelegate:self]; please reply me. ...

java - Regex to find key->value in string -

i have string need array (2 - dim) of key->value pairs. a "match" when there -> between 2 words, mo spaces before , after -> for example input string: skip_me key1->value1 key2->value2 skip_me_2 key3->value3 skip_me_3 skip_me -> also the result should array: key1,value1 key2,value2 key3,value3 this code: pattern p = pattern.compile( "\\s*([^(->)]+)->([^(->)]+)\\s*" ); matcher m = p.matcher("skip_me key1->value1 key2->value2 skip_me_2 key3->value3 skip_me_3"); while( m.find() ) { system.out.println( "key:" + m.group(1) + "value:" + m.group(2) ); } my regex wrong. please assist. matches word characters (letters, digits, , underscore _ )... many can pattern.compile( "(\w+)->(\w+)" );

python + django + ftp app .. processing files , indexing and download -

i have question regarding building django app simple, getting username , password user of accounts in ftp, app retrieve list of files, can order file modified, name etc.. , download file there tool ftptool 0.5.1 problem can't find way file info when created ? http://pypi.python.org/pypi/ftptool/0.5.1 any solution? >> a_host.listdir("/a_dir") (['other_dir', 'some_dir'], ['foo', 'bar']) looking @ documentation , source fo ftptools there seems no way of getting meta information on files unless download them. using low level ftplib python includes, there ftp protocol command mlsd 1 looking for. might have check though, if ftp server supports that

shell - how to append string -

i parsing file selected string , build single line, however, don't know how it(as shown in //add...) in shell scripts while read line tt=`echo $line | cut -d'|' -f2 | cut -d'"' -f1` //add $total = add tt parts big string seperate ", " done < tmp_file echo $total >> outfile thank you you append in shell using assignment , variable expansion: total="${total}, ${tt}" the curly braces ( {} ) aren't necessary in case find distinguish variables when they're next each other this. this give leading ", ". can work around this: total="${total:+${total}, }${tt}" the ${variable:+value} construct expands value if variable set.

Scan a file to search pre-defined c keywords and print them on console -

how can scan file word , print line containing word in c programming? i trying find way scan file keyword , print line containing word. off rough start. here have: #include <stdio.h> void getdsk (void); void getdsk () { file* fp; char result [1000]; fp = popen("diskutil list","r"); fread(result,1,sizeof(result),fp); fclose (fp); while(!feof(fp)) { if(//line contains "test".) { //show line. } } } int main(int argc, const char * argv[]) { getdsk(); return 0; } edit: did needed. #include <stdio.h> void getdsk (void); void getdsk () { printf("your available windows installations are:\n"); file* fp = popen("diskutil list","r"); char line[1024]; while(fgets(line, sizeof(line), fp)) { if (strstr(line,"microsoft")) { printf("%s", line); } // if line contains text, print ...

php - Error while upgrading WordPress - Fatal error: Out of memory -

when trying upgrade wordpress (current version 3.1) wordpress 3.2.2, getting stage error: fatal error: out of memory (allocated 29360128) (tried allocate 3155893 bytes) in /homepages/32/d108770064/htdocs/wordpress/wp-includes/class-http.php on line 1420 how fix , update wordpress? the thing try , uninstall old wordpress 3.1. then, download wordpress 3.2.2 website , install new version.

GtkD (the Gtk+bindings for the D language) why compile it? -

i've been using gtkd d programming language create native applications. i've downloaded necessary files , got running can compile , produce sample apps. my question in of guides tells compile gtkd on platform using point? once compiled end single lib file on windows (gtkd.lib) , 3 lib files on linux (ending in *.a). these files , how used? said seems working without doing these files. i'm guessing can statically link these? what's for? avoid compiling gtkd source each time? did try using pragma('lib', 'gtkd.lib') statement didn't seem anything. can shine light on or explain why these files needed? source files imported aren't compiled, parsed symbol names , function signatures (and templates) creating libs avoid needing recompile entire library each time need rebuild , compiler can use .di files imports this stems olden days compiling took ages, , can used keep library closed source

character encoding - When I use UTF-8 instead of ISO-8859-1, jquery's dialog stops working -

i've been working on own website - http://rapcities.com (warning - song plays automatically) i added legal text need site, , found there lots of random unwanted characters appearing (such Â, â, , ¨). searching led me change character encoding of site utf-8 - though none of text in site uses non-western characters. changing encoding fixes problem, brings larger one. whenever site displayed utf-8 character encoding, jquery dialog no longer works on site. the dialog should appear automatically when site first opens (with artist biography). dialog should appear when clicking on dmca/terms of service/privacy policy links, , third should appear when clicking basket hearts inside @ top right corner of site. i thoroughly confused going on - both in regards original problem , new one. have ideas? best, sami i unterminated string literal error message in console when go page. points switch statement in showlegal(number) function. instead of putting whole bunch of ...

android - Monodroid issue with jar binding zubhium sdk -

iam trying bind jar(zubhium sdk jar) file mono droid project. have followed guide on xamarins website , created new binding project reference mono droid project. having issues package names. following error: error 3 package com.zubhium.interfaces not exist com.zubhium.interfaces.zubhiumlistener c:\users\jbp\desktop\ny\cmsapp.droid\obj\debug\android\src\mono\com\zubhium\interfaces\zubhiumlistenerimplementor.java 8 25 cmsapp.droid genrated source: package mono.com.zubhium.interfaces; public class zubhiumlistenerimplementor extends java.lang.object implements mono.android.igcuserpeer, com.zubhium.interfaces.zubhiumlistener and because when project wrapped automaticly adds mono(.com.zubhium....) package name. cant find how remove mono or if can set rule add part. i tried put <attr path="/api/package[@name='com.zubhium.interfaces']" name="managedname">mono.c...

microsoft metro - XAML: Groupfooter for GridView on Windows 8 ReleasePreview -

i'm trying show group footer in gridview. have found questions how can create group footer in wpf listview ( gridview ) , don't seem fit anymore. i tried using following containerstyle: <groupstyle.containerstyle> <style targettype="groupitem"> <setter property="template"> <setter.value> <controltemplate targettype="groupitem"> <stackpanel> <contentpresenter /> <itemspresenter /> </stackpanel> </controltemplate> </setter.value> </setter> </style> </groupstyle.containerstyle> this shows group headers, items disappear. i'm pretty sure it's simple miss, don't it.

jquery - expand div or UL based on content overflow -

how can make div expand when there lots of content within it? html: <div class ="content"> test <br /> test <br /> test <br /> test <br /> test <br /> test <br /> test <br /> </div><br /> <div class="click-here">click here see more</div> css: div.content { height:100px; width:300px; border:1px solid red; overflow:hidden; } div.click-here { border:1px solid green; width:200px; } here example: http://jsfiddle.net/nvcvy/1/ jquery or css? would jquery scroll better solution? or display using css? if expansion height , on click of button do: ​$('.click-here').click(function() { $('.content').css('height', 'auto'); });​​​​​​​​​​​​​​​ http://jsfiddle.net/nvcvy/3/

Is the order of fields in the ILDASM tree view correct or is the order in the MetaInfo correct? -

in trying determine precise order of fields in .net value type, looked both @ ildasm tree view , @ ildasm "metainfo" (i.e., actual il). order of fields in 2 views of data inverse. for example, tree view of system.runtime.interopservices.filetime lists dwhighdatetime before dwlowdatetime. (i post image, lack enough reputation points here so). on other hand, here corresponding il, using view>>metainfo>>show! in ildasm: typedef #1655 (02000678) typdefname: system.runtime.interopservices.filetime (02000678) flags : [public] [sequentiallayout] [class] [sealed] [ansiclass] [beforefieldinit] (00100109) extends : 02000009 [typedef] system.valuetype field #1 (04001e2e) ------------------------------------------------------- field name: dwlowdatetime (04001e2e) flags : [public] (00000006) callcnvntn: [field] field type: i4 field #2 (04001e2f) ------------------------------------------------------- field name: dwhighdatetime (04...

localization - iOS App on sale, works great except in Hong Kong -

i've made ios app client french @ origin, , localized can display english if phone not french. works great on iphone (i've tested several langages). my client (who in hong-kong showing app...) told me on hong-kong's iphones, app crashes right after default screen. possibly cause that? i'm asking here because have no idea that. info, implement push notifications. i'm sorry don't have more info, not out there can't have log. has had problem before? known app work in countries , not in others? you should try simulate problem app changing: language preferences. region preferences. app store apple id apple id hk region (if have implemented in-app purchases). changing time preferences hk date , time.

web services - Ksoap2 Runtime Exception SoapObject ClassDefNotFound in Android -

i trying use .net service in android application using ksoap2 library. added reference jar of ksoap2-android-assembly-2.6.5-jar-with-dependencies in project. when run code runtime exception saying java.lang.noclassdeffound : org.ksoap2.serialization.soapobject. can please ? code. soapobject request = new soapobject(namespace, method_name); soapserializationenvelope envelope = new soapserializationenvelope(soapenvelope.ver11); envelope.dotnet = true; envelope.setoutputsoapobject(request); httptransportse androidhttptransport = new httptransportse(url); try { androidhttptransport.call(soap_action, envelope); soapobject resultsrequestsoap = (soapobject) envelope.bodyin; tvtemp.settext("received :" + resultsrequestsoap.tostring()); } catch (exception e) { e.printstacktrace(); } i solved problem using link provided first commentator on question. leaving answer here in case programmer faces...

Communication issue between PHP and jQuery -

i have page generated php this: <?php //in original code, retrieved databas.. $users = array( array('id'=>1, 'login'=>'login1', 'email'=>'email1') ); foreach($users $user){ echo '<tr><td>'.$user['login'].'</td><td>'.$user['email'].'</td><td><button class="button-delete">delete</button></td></tr>'; } ?> then, in front side have script: $('.button-delete').click(function(){ var id=0; alert(id); }); my aim make delete button perform ajax call delete user. till didn't got there yet, problem how user id? you can send id within button data , after. <?php //in original code, retrieved databas.. $users = array( array('id'=>1, 'login'=>'login1', 'email'=>'email1') ); forea...

iphone - NSDictionary or NSKeyedArchiver -

in model portion, have data types properties property list data types. eventually, users sending each other these data items on network posting , reading server. question is, should using nscoding , nskeyedarchiver (as in second code block below, makes ugly xml imho) or should subclass nsdict can use dictionarywithcontentsoffile: , writetofile:atomically: pretty xml? @interface word : nsobject <nscoding> @property (strong, nonatomic) nsstring *language; @property (strong, nonatomic) nsstring *name; @property (strong, nonatomic) nsdictionary *detail; @property (strong, nonatomic) nsstring *username; @property (strong, nonatomic) nsstring *userid; @property (strong, nonatomic) nsarray *files; - (void)copyfromtemporaryfiles:(nsarray *)temporaryfiles; // populates self.files @end and @interface category : nsobject <nscoding> @property (strong, nonatomic) nsstring *name; @property (strong, nonatomic) nsdictionary *detail; @property (strong, nonatomic) nsdate *updated...

objective c - How to handle big pictures in iPad application -

i have couple of backgrounds dimensions of entire ipad screen (1024x768) , ask myself how include them project. should stuff them onto sprite sheets or include them separately or load them web ? if app less 10mb, include them in project each file individually. i not use sprite sheets. sprite sheets not offer space advantage png encoding, , not suited application image changing infrequently (it make memory footprint bigger). if app near or on 10mb app store install on 3g limit, include default background in project , load rest on demand using framework such sdwebimage.

cordova - Zxing Barcode Scanner PhoneGap Plugin iOS landscape mode -

i have implement zxing barcode scanner in ipad using phonegap 1.7.0 , zxing barcode scanner https://github.com/phonegap/phonegap-plugins/tree/master/ios/barcodescanner . orientation portrait only. want change landscape modify code if ([previewlayer isorientationsupported]) { [previewlayer setorientation:avcapturevideoorientationportrait]; } and code too if (interfaceorientation == uiinterfaceorientationportrait) return yes; in cdvbarcodescanner.mm , change value of portrait landscaperight. problem video not full screen, there has black portion in right. when scan barcode success when portrait not landscape in landscape mode. is there solution make landscape mode perfect? delete this if (result.empty() && hints.gettryharder() && image->isrotatesupported()) {} on zxing-all-in-one.cpp file

Issue with toggling visibility in a series of menus using jQuery -

the coding bit messy , on place forgive me that, i'm in rush finish asap. little disclaimer out of way... i've been asked create form has 3 layers of seperation can navigate using 2 menus - layer of tabs @ top navigate first level. side menu allow user navigate question fields level down, final level being accordion display of questions. has done way, clients stubborn refuse done way. has ie6 compatible >< you can see code dump here: jsfiddle alright. issue. whats happening firstly, when clicking tabs @ top should able navigate between 2 tabs have examples, worked in jquery v.3 hides current tab along other. have no idea whats going. other same regarding side menu, instead of showing next selected questions hides them aswell. i've been working on ages point can't make of it. if can lend fresh set of eyes or @ least point me in right direction here great. again, sorry state of code, first attempt @ this. cheers! it seems tab variable pass s...

Sin, cos etc for Python 2 Decimal? -

in python 2.6, found decimal equivalent of sqrt(pi) is decimal(pi).sqrt() is there sin, cos or other (inverse) trigonometric functions? the docs mention how calculate cos , sin computationally. decimal(pi).cos() doesn't exist nor from decimal import cos update : problem using default trigonometric functions defeats point of using decimal if convert them float , every time want calculate something. (also typing decimal around every calculation annoying, guess make wrapper function) values of sin(a) , cos(a) rational numbers particular angles (see http://planetmath.org/encyclopedia/rationalsineandcosine.html ) can't store values of sin(a) or cos(a) decimals without losing precision. defeats purpose of converting sin , cos values decimal , having built-in functions return sin , cos values decimals. moreover, can't store rational numbers decimal without losing precision because python's decimals (-1)**_sign * _int * 10**_exp divisor of ration...

neo4j - Return node if relationship is not present -

i'm trying create query using cypher "find" missing ingredients chef might have, graph set so: (ingredient_value)-[:is_part_of]->(ingredient) (ingredient) have key/value of name="dye colors". (ingredient_value) have key/value of value="red" , "is part of" (ingredient, name="dye colors") . (chef)-[:has_value]->(ingredient_value)<-[:requires_value]-(recipe)-[:requires_ingredient]->(ingredient) i'm using query ingredients , not actual values, recipe requires, return ingredients chef not have, instead of ingredients each recipe requires. tried (chef)-[:has_value]->(ingredient_value)<-[:requires_value]-(recipe)-[:requires_ingredient]->(ingredient)<-[:has_ingredient*0..0]-chef but returned nothing. is can accomplished cypher/neo4j or best handled returning ingredients , sorted through them myself? bonus: there way use cypher match values chef has values recipe requires. far i've retu...

nservicebus3 - NServiceBus 3.2 - NullReferenceException at NServiceBus.Timeout.Core.TimeoutRunner.CacheExistingTimeouts() -

a big thank-you andreas in helping previous nsb 3.2 issue (http://stackoverflow.com/questions/10904857/nservicebus-endpoints-looking-for-ravendb-for-timeouts-after-upgrading-3-0-3). after implementing change have fatal exception during startup of each service. each service (in class implementing iwantcustominitialisation) configured follows; configure.with() .dbsubcriptionstorage() .sagas() .nhibernatesagapersister() .nhibernateunitofwork() .disablesecondlevelretries() .disabletimeoutmanager(); this in log during startup: 2012-06-08 21:49:46,946 [4] info nservicebus.host - going activate profile: nservicebus.performancecounters, nservicebus.host, version=3.2.0.0, culture=neutral, publickeytoken=9fc386479f8a226c 2012-06-08 21:49:46,947 [4] info nservicebus.host - going activate profile: nservicebus.production, nservicebus.host, version=3.2.0.0, culture=neutral, publickeyto...

objective c - How do I do a Fade/No transition between view controllers -

Image
is possible fade in , fade out transition between view controllers in storyboard. or without transition. if it's possible, what's code it? if presenting modal view controller, can specify modaltransitionstyle of uimodaltransitionstylecrossdissolve . if doing segue in storyboard, select attributes inspector segue, , specify transition style there: if presenting view controller programmatically, can define modal segue between view controllers in storyboard "transition" of "cross dissolve" , have source view controller perform segue: [self performseguewithidentifier:@"presentsegue" sender:sender]; or, if calling presentviewcontroller : uiviewcontroller *controller = [self.storyboard instantiateviewcontrollerwithidentifier:@"yourstoryboardid"]; controller.modaltransitionstyle = uimodaltransitionstylecrossdissolve; [self presentviewcontroller:controller animated:yes completion:nil]; in ios 7, apple has provided ne...

asp.net mvc 3 - How to do Jquery ajax post to controller mvc -

i can't figure out not doing right,from viewmodel,i try grab user {**tousername , messagebody } , #tousername** correctly sent while #body null in controller when debug .i have following jquery code: $("#sendmessage").click(function () { var message = grabmessage(); var jsondata = json.stringify(message, null, 2); $.ajax({ url: '@url.content("~/message/compose/")', type: 'post', data: jsondata, datatype: 'json', contenttype: 'application/json; charset=utf-8', success: function () { $('#default_message').append("message sent "); switchtosentmessagestab(); }, error: function (request, status, err) { alert(status); alert(err); } }); return false; }); function switchtosentmessagestab() { ...

Always return to same activity in android with extras after search -

ok, here go: i have search interface/ dialog (the type gets created system) calls fileslist , activity when called without search intent show of users items (this works fine when called main activity) the query search filters these results fine, when user selects 1 of these results return previous activity, whereas want return main activity, passing id of selected item (which can fine) also, in whichever activity call search from, onactivityresult not called (because search intent isn't result?) basically, return main activity after search, returning item selected in fileslist edit: to select item user clicks listview , calls method: protected void onlistitemclick(listview l, view v, int position, long id) { log.d("onclick id", ((note)data.get(position)).id); note array=(note)data.get(position); intent.putextra("id", array.id); intent.putextra("tag", currenttag); setresult(result_ok, intent); finish(); } and...

sql - MS Access 2007 update/insert or merge or union -

i have been searching quite while how should pretty easy in ms access 2007. i have main table, items_moved, tracks number of files received, type, day. basic structure is: id (autonumber), drive (text), type (text), date (datetime), file_count (number), file_size (number) typical data looks like: 1777, f:\snaps, pics, 6/09/2010, 66, 151616131 1778, f:\snaps, pics, 6/10/2010, 5, 464864 1779, g:\pics, pics, 6/09/2010, 58, 45645646 1780, g:\pics, pics, 6/10/2010, 70, 123456667 i have temp table exact same data structure. temp table generated starting (and including) last day of items_moved table , finding what's new. typical data looks like: 1, f:\snaps, pics, 6/10/2010, 366, 6531616131 2, f:\snaps, pics, 6/11/2010, 5, 464864 3, g:\pics, pics, 6/10/2010, 70, 123456667 4, g:\pics, pics, 6/11/2010, 56, 123645964 all i'm trying append temp table on main table that: there no duplicates (based on drive , date) if temp table has matching drive , date , larger v...

javascript - How can I get instances of different tabs such that I can store variables / perform operations specific to respective tabs -

note: using gwt build firefox extension say have class operates on different tabs of browser: class tabroutine{ element tab; static int tabdata; public tabroutine(element tab){ this.tab=tab; } public void tabmethod(){ //operation on tab } } for each tab must create instance of class want destroy once tab closes. therefore each tab has int tabdata related it. here how approached it: i have document element pertaining each tab available me (i have window object if helps). therefore, decided use gbrowser.getbrowserfordocument(doc); my question browser element unique tabs? imply have 2 tabs documents doc1 , doc2. if map these browser elements objects of tabroutine, each individual tab return same (and correct) browser can find object related it? please tell if aspect of question unclear , i'll elaborate. lot! yes, each <browser> element associated particular tab. not bound particular content document - different site can loa...

osx - Shift-selection and emacs 24 -

i use emacs 24 (osx) , have problem shift-selection. if select region mouse, text highlighted , automaticaly saved on kill ring (i can yank immediately). shift-selection, text highlighted have manualy save text ( m-w ) able yank it. there way shift-selection hightlights text , saves onto kill ring ? selecting text mouse not place onto kill ring default (it copies x clipboard). there various ways in can customise how emacs interacts clipboard. see: c-h i g (emacs) cut , paste ret is there way shift-selection hightlights text , saves onto kill ring ? i'm not sure there's way detect you've stopped selecting things, perhaps advise handle-shift-selection set temporary post-command-hook run custom function place region in clipboard (and remove post-command-hook). edit: hang on, describe happens me in emacs 24.1 on ubuntu. if shift-select text in emacs , middle-click mouse in application, paste selected text. try testing when running emacs -q ...

javascript - Press "enter" to submit form doesn't work (js) -

i'm using google gadget write short script , try insert google site. when user press go button, javascript function triggered , works fine, when user press enter , error occurs: missing or malformed url parameter i'm not sure it's caused code or google gadget/site. my html code: <form name="theform"> <input type="text" size="20" id="search"/> <input type="submit" value="go!" onclick="gotourl(this.form)"> </form> javascript function function gotourl(dl) { var mysearch = document.getelementbyid("search").value; url='some_url'+mysearch; window.open(url,'_blank'); } thanks you should use onsubmit event on form instead of onclick event of button: <form name="theform" onsubmit="gotourl(this)"> <input type="text" size="20" id="search"/> <input type=...

jsf 2 - Navigate without redirect? -

i have navigation-menu: ... <p:menuitem id="id1" value="page 1" action="home.xhtml?faces-redirect=true" actionlistener="#{homebean.somemethod(1)}"/> <p:menuitem id="id2" value="page 2" action="other.xhtml?faces-redirect=true" actionlistener="#{otherbean.somemethod(1)}"/> now want rid of these redirects. tried attribute url instead of action, actionlistener isn't called anymore. how can call listener in case <p:menuitem id="id1" value="page 1" url="home.jsf"> ... here (or maybe somewhere else) should go call listener ... </p:menuitem> jonny the p:menuitem supports post , get. 1 of these selected depends on presence of url attribute. quote pf documentation : this decided url attribute, if present menuitem request, if not parent form posted. if want invoke action method on server side need post. if don't want redi...

javascript - Jcarousel and display: none + SEO concern -

i using jcarousel on page in 3 different sections. show first section , hide other 2 display: none . i have done googling , found common problem because has display of none automatically has width of 0 , hence jcarousel cannot set properly. i found post on so: hide jcarousel when page loads that deals putting content don't wanna show yet moving off page, that, wondering, bad seo purposes? in google wouldn't content being outside of page? do have other options? ok, fixed issue letting content load first , once page data loaded ran function hide relative content. code in header.. runs hidehomecats function once on page has been loaded. $(window).load(hidehomecats); where hidehomecats function hides relevant content. hope helps else. :)

sql - How to get all rows from left table in a join statement? -

Image
i have 2 tables. 1 employee_mstr , other employeeleaverequest_mstr . please me achieve this. thanks in advance. select tab1.emp_cd, tab1.emp_name, sum(tab2.num_dy) employee_mstr tab1, "2nd table records" tab2 tab1.emp_cd = tab2.emp_cd group tab1.emp_cd, tab1.emp_name; should work, set correct table name 2nd table.

android - How to open installed apk by URL link? -

i want this: click link (a url of apk) if apk didn't install before, apk downloaded. if apk have installed apk before, apk open. so possible open apk url link? you can use packagemanager class search package, 1 want start downloading, if package present can call launch intent. some examples here. how list of installed android applications , pick 1 run

sms - Modify ASN.1 BER encoded CDR file -

i processing cdrs (call detailed record). dont know file is? supposed 'asn.1' format ber encoded files. problem want modify data in files dont know editor or decorder can use modify files. searched lot , found many asn.1 decorder asn.1 bsr viewer/editor no 1 allows want perform. this cdr supposed contain customer detail, phone number, telecom services(telephony, sms, mms) etc. one of cdr name - ggsn01_20120105000102_56641-09-12-01-09%3a30 , file type - file no other information available. when opening file in text editor show rectangles , text data. any telecom guy can definite me. new telecom domain. please ask if need more information. thanks you need know asn.1 , ber able correctly edit file. ber binary format, not ascii text, see in text editor. modifying embedded plain text safe if not changing length of string; ber uses nested structures encode lengths , change in length of string value requires adjustments encoded lengths of enclosing structures...

c - Where does linux store my syslog? -

i wrote simple test application log in log file. using linux mint , after application executes try view log using command: tail -n 100 /var/log/messages but file messages not exist neither tested or something. below can find code. maybe doing wrong, file isn't stored there or need enable logging in linux mint. #include <stdio.h> #include <stdlib.h> #include <syslog.h> void init_log() { setlogmask(log_upto(log_notice)); openlog("testd",log_cons | log_pid | log_ndelay, log_local1); } int main(void) { init_log(); printf("session started!"); syslog(log_notice, "session started!!"); closelog(); return exit_success; } on ubuntu machine, can see output @ /var/log/syslog . as noted others, syslog() output logged /var/log/syslog file. can see system, user, , other logs @ /var/log . for more details: here's interesting link .

Changing brightness of display (C#) -

possible duplicate: c# setting screen brightness windows 7 i searched online topics chanding brightness of display through c#. part, got links change gamma in windows ( here & here ) , working fine me. wondering if correct way of reducing brightness or dimming display (does save power reducing brightness of monitor does?) is way reduce brightness or there better way same? i'm on windows 7 (i forgot default gamma value of windows is?! somebody?) contrast/brightness properties inside of physical monitor; not software. windows knows gamma. tools , guides find, secretly edit gamma, not same brightness/contrast. but did find link: "how control ‘real’ brightness , contrast of monitors software" this not technical explanation of how it's done, lists problems common 'tools' claim able it. instead demonstrates use of couple of programs communicate monitor. monitor video card, need support ddc protocol. maybe can use ddc protocol...

jquery - jqGrid - how to pass both the boolean checked state value and the actual unique value to a checkbox in jqGrid? -

i have jsp page multiple instances of jqgrid. 1 column of grid has checkbox representing if row selected or not. need have normal html checkbox in jqgrid - 1 has both checked/unchecked boolean state , actual unique value like: <input type="checkbox" name="vehicle" value="car" checked="checked" /> in jqgrid facing limitation wherein can pass 1 value checkbox. in colmodel of jqgrid have this: colmodel:[ {name:'assign', index:'assign', width:200, editable:true, edittype:'checkbox', formatter:"checkbox", formatoptions:{disabled : false}} ] in passing data jqgrid have kind of data: var mydata = [ {assign:"${assignbool}"} ]; however value being set in colmodel [] "assign" either boolean value determining if checkbox checked or not or actual value want set checkbox determine checkbox checked. while passing boolean value checkboxes checked corre...

validation - Spring MVC validate a checkboxes list -

i have following beans: public class codedentity { private string name; private string code; // getters , setters } public class myproduct { @javax.validation.constraints.size(min = 1) private list<codedentity> codedentities; // getters , setters } as see codedentities list must have @ least 1 element. in controller validate size of list : @requestmapping(value = "/**", method = requestmethod.post) public string submit(@valid final myproduct myproduct, final bindingresult result, final model model) { // ... } and jsp : <c:foreach items="${codedentitieslist}" var="codedentity" varstatus="loopstatus" <form:checkbox path="myproduct.codedentities[${loopstatus.index}]" value="${codedentity.code}" cssclass="checkbox" /> </c:foreach> the problem here following : when submit jsp without checking checkbox, spring mvc returns non-empty list...

extjs4 - How To Get The TotalPage of a store? -

in program i'am using grid pagination. in particular situvation need totalpage count of store.any way it? please me.... your server should send total number of records, this: { success:true, total:999, records:[ { id:1, name:'arundev pv' } ] } then can use store.gettotalcount() value. http://docs.sencha.com/ext-js/4-1/#!/api/ext.data.store-method-gettotalcount you can customize name of "total" property http://docs.sencha.com/ext-js/4-1/#!/api/ext.data.reader.reader-cfg-totalproperty

javascript - do <something> N times (declarative syntax) -

is there way in javascript write easily: [1,2,3].times { something(); } any library might support similar syntax maybe? update: clarify - something() called 1,2 , 3 times respectively each array element iteration this answer based on array.foreach , without library, native vanilla . to call something() 3 times, use: [1,2,3].foreach(function(i) { something(); }); to complete questions, here's way call something() 1, 2 , 3 times respectively: it's 2017, may use es6: [1,2,3].foreach(i => array(i).fill(i).foreach(_ => { something() })) or in old es5: [1,2,3].foreach(function(i) { array(i).fill(i).foreach(function() { something() }) }))

Change the URL in chrome after the page has loaded -

i've written following script change url of tab in chrome, can't figure out how automatically run on every page. var nytimes = /.*nytimes\.com.*/; var patt = /(&gwh=).*$/; function updateurl(tab){ if(tab.url.match(nytimes)) { var newurl = tab.url.replace(patt,""); chrome.tabs.update(tab.id, {url: newurl}); } } chrome.tabs.onupdated.addlistener(function(tab) {updateurl(tab);}); i put background page, isn't working. need put code somewhere else run? i suggest read content scripts . you're looking need understand have limited access chrome.* api, you'll have use message passing in order use current functionality. however, using content scripts can make simpler using 1 of proposed solutions. solution 1 assuming want send redirect same url every time, can configure extension run content script on ny times site. example; content script: content.js location = 'http://example.com'; solution 2 how...

CSV import via PHP -

i'm importing .csv application following: if (($handle = fopen($file, "r")) !== false) { while (($data = fgetcsv($handle, 1000, ",")) !== false) { $num = count($data); echo "<p> $num fields in line $row: <br /></p>\n"; $row++; ($c=0; $c < $num; $c++) { echo $data[$c] . "<br />\n"; } } fclose($handle); } it sort of works it's far perfect. wanted first out row heads , put them array , loop round each row data sets in. it seems having delimitting problems first row (heads) including few parts of second row. i exported .csv file straight excel. wonder if there encoding tricks etc might missing. fgetcsv doesnt detect line endings. try using before fgetcsv call: ini_set('auto_detect_line_endings', true);

how to extract fields with sed and regex -

i have input looks this: [03/jun/applications/somejunk/morejunk/ 200 and want use sed + regex extract in form: 03/jun 200 here's regex i'm trying, can't figure out how make extract want. \([0-9]{2}/[a-za-z]{3}/\).* \([0-9]{3}\) any awesome. here's test code: $ echo "[03/jun/applications/somejunk/morejunk/ 200" | sed 's,\\([0-9]{2}/[a-za-z]{3}/\\).* \\([0-9]{3}\\),\1 \2,g' this works sed 's;\[\([0-9]\{2\}/[a-za-z]\{3\}\)[^ ]*\(.*\);\1\2;' $ echo "[03/jun/applications/somejunk/morejunk/ 200" | sed 's;\[\([0-9]\{2\}/[a-za-z]\{3\}\)[^ ]*\(.*\);\1\2;' 03/jun 200 match 2 digits [0-9]\{2\} match single slash / match 3 letters [a-za-z]\{3\} group them \1 -- parenthesize them match until space [^ ]* match after space (including space) , hold in \2 return \1\2 \2 contains space

android - Switching between activities with java animation (defined programmatically) -

if have animations defined in xml can animate between activities //calls new activity startactivity(new intent(this, newactivity.class)); //set transition -> method available android 2.0 , beyond overridependingtransition(r.anim.push_left_in,r.anim.push_up_out); but have animation defined in java. function "overridependingtransition(int , int)" takes int arguments animations. how can use programmatically defined animations instead? i found out solution here http://blog.robert-heim.de/karriere/android-startactivity-rotate-3d-animation-activityswitcher/comment-page-1/#comment-12025

MySql JOIN table as content? -

i have table of contact details (name, province, etc) , have table of 1 word answers , have same user id. want join 1 word answers contact details get. first name, last name, province, email, list of 1 word answers separated , or character i know need sub select how can take values , separate them character , return in main select? you can of group_concat : select name, province, (select group_concat(word) answers a.user_id = c.user_id) words contacts c

How to manage predefined groups in couchdb -

i new couchdb bear me if easy. i trying prototype system there group of user can share within database each other. example, think of message board system once user allow particular board, can view/update/delete in message board. also, user can join multiple boards. from read far, way thinking achieve have multiple database within couchdb server. each database represents board , since board doesn't need talk each other, give nice separation between boards. my question user authorization. know can create user in couchdb , assign them acl within 1 "database", there way in couchdb controls user access in "database" level? ie. database can user read/write/update? the way see have table in "application" database can control user access, mapping user database. you seem contradict yourself. know can assign user acl within 1 database, , ask if there's way control user access in database. all authorization @ database level. rea...

XML parsing speed up. PHP -

i'm here ask concepts can make process faster: foreach($xml->results->concepts->concept $value2){//this original game. $total_concepts++; foreach($xml1->results->concepts->concept $value1){//this similar game. $total_similar_concepts++; if(strcmp($value2->name, $value1->name)==0){ $comparisons++; break; } } } essentially, i'm comparing each 'concept' of original game each 'concept' of each 'similar' games. this algorithm takes 11.6 seconds on average complete. there can make run faster? thinking perhaps parsing xml wasn't best do. the xml parsing unlikely reason problem. if has xml it's i/o, meaning takes long fetch data disk. what doing combining elements in $xml elements in $xml2 o(n^2) complexity problem. can try reduce complexity making use of hashmap, easy in php because got associative arrays hashmaps: foreach($xml->results->...

struts2 - Unable to setup Struts 2 environment -

i'm getting error message in index.jsp file can not find tag library descriptor "http://struts.apache.org/tags-logic" how rectify it? refer hello world application tutorial link , can compare code sample codes , solve issue. jar files required available there in link ( except mysql connector).

grammar of PDF 1.7. (BNF or variant) -

i'm looking grammar of pdf 1.7 (bnf or variant) absolutely not googleable pdf binary format. binary formats not context-free, , pdf no exception. in pdf example need read , interpret size of binary stream before parsing stream. bnf can used context-free grammars , there no such thing bnf grammar pdf. take @ specification here: pdf reference document

django - ModelForm User Mixin -

i've got models user field. for purpose i'd create form mixin add self.user instance (which provided form in views). possible ? here's example class userformmixin(object): """removes user instance kwargs , adding object""" def __init__(self, *args, **kwargs): super(userformmixin, self).__init__(*args, **kwargs) self.user = kwargs.pop('user') def save(self, **kwargs): obj = super(userformmixin, self).save(commit=false) obj.user = self.user if kwargs['commit']: return obj.save() else: return obj what i'd achieve: class someformwithuserfield(userformmixin, modelform): class meta: model = somemodelwithuserfield fields = ['fields without user'] def save(self, **kwargs): data = super(someformwithuserfield, sefl).save(commit=false) #data user prepended #do other stuff data ...

How can I specialize a C++ template for a range of integer values? -

is there way have template specialization based on range of values instead of one? know following code not valid c++ code shows do. i'm writing code 8-bit machine, there difference in speed using ints , chars. template<unsigned size> class circular_buffer { unsigned char buffer[size]; unsigned int head; // index unsigned int tail; // index }; template<unsigned size <= 256> class circular_buffer { unsigned char buffer[size]; unsigned char head; // index unsigned char tail; // index }; try std::conditional : #include <type_traits> template<unsigned size> class circular_buffer { typedef typename std::conditional< size < 256, unsigned char, unsigned int >::type index_type; unsigned char buffer[size]; index_type head; index_type tail; }; if compiler doesn't yet support part of c++11, there's equi...

git - How to use terminal commands with Github? -

i have forked private repository (an iphone project) follows: cd nameofdirectory git init git clone forkedurl now want push changes done me forked repository main admin can review written code , merge main repository. how can push changes done me forked repository using terminal on macos? you can't push other people's repositories. because push permanently gets code repository, not cool. what should do, ask them pull repository. done in github going other repository , sending "pull request". there informative article on github's itself: https://help.github.com/articles/using-pull-requests to interact own repository, have following commands. suggest start reading on git bit more these instructions (lots of materials online). to add new files repository or add changed files staged area: $ git add <files> to commit them: $ git commit to commit unstaged changed files: $ git commit -a to push repository (say origin ): $...

binding - sum the fields of the bind inside a form, from cfc -

i need calculate total of invoice. invoice created form, amount, quantity , tax fields, sum of fields made bind in cfinput. can not make sum of rows, total. tried operations, not arriving @ solution this example code: <cfform action="" method="post"> <cfloop from="1" to="3" index="i"> q.ta <cfinput type="text" name="quantita#i#" value="0"> + importo <cfinput type="text" name="importo#i#" value="0"> + tax <cfinput type="text" name="iva#i#" value="0"> = totale <cfinput type="text" name="totale#i#" value="0" bind="cfc:somma.getsomma({quantita#i#},{importo#i#},{iva#i#})"> <br /><br /> </cfloop> cfc: <cfcomponent> <cffunction name="getsomma" access="remote" returntype=...

Today's Date in Perl in MM/DD/YYYY format -

i'm working on perl program @ work , stuck on (what think is) trivial problem. need build string in format '06/13/2012' (always 10 characters, 0's numbers less 10). here's have far: use time::localtime; $tm=localtime; ($day,$month,$year)=($tm->mday,$tm->month,$tm->year); you can fast, using 1 posix function. if have bunch of tasks dates, see module datetime . use posix qw(strftime); $date = strftime "%m/%d/%y", localtime; print $date;

c# - Returning nearest document grouped by field in MongoDB using GeoNear -

i'm using official c# driver query collection in mongodb using geonear. the documents this:- { "_id" : "1" , "resource" : { "_id" : "9", "type" : "aaa" }, "site" : { "_id" : "4123" , "location" : { "longitude" : 145.012345, "latitude" : -30.012345 } } } there multiple combinations of resources , sites in many-to-many scenario. i have geonear working ok, need filter results on other criteria. i have basics working, can example return of particular resource type, need query return closest document each resource type. example if have 10 resource types , several hundred sites (potentially thousands of combinations/documents), query return @ 10 documents... 1 each of resource types, showing closest site each (the query may in fact return less that, if there no si...

How to load/write data into a newfile using selenium IDE? -

i'm using selenium ide record & replay testcase. during this, stored values in variables.now i've load/write these variable's value new file.how can ? possible ? it's not possible using selenium ide, can store using selenium rc or webdriver (junit or nunit).

jquery - Ajax call to HTTPS failing -

Image
i trying call spring-mvc controller responsible go ahead login/authorization mechanism using spring security. here requirements spring security need have request https else throw error. i followed following tutorial accomplish /implementing_ajax_authentication_using_jquery . here piece of jquery code jquery("#loginform").submit(function(e) { e.preventdefault(); jquery.ajax({ url: "https://localhost:9002/myapp/springsecurity/login.json", beforesend: function(xhr) { xhr.withcredentials = true; }, type: "post", data: jquery("#loginform").serialize(), datatype: 'application/json', success: function(data, status) { if (data.loggedin) { // location.href = gethost() + '${ctx}/users'; //login_pannel alert("jai ho"); ...

xaml - Trying to begin a storyboard on change of a property in WPF application -

i have simple mvvm application. contains property, change true when method correctly executes, , false if now. when property changes, few seconds display "passed" or "failed" on status bar of wpf application , have fade away. so have read stackoverflow, , googled intensely, no avail. think have misunderstood how need structure storyboard. in statusbar have added storyboard, trying trigger in <usercontrol.resources> @ beginning of xaml file. correct ? @ moment using dummy values of 0/1, assume correct practice use booleantostring converter make, or perhaps there better way? so status bar contains : <statusbar > <statusbar.resources> <storyboard x:key="statusbar" > <doubleanimationusingkeyframes storyboard.targetproperty="(uielement.opacity)" storyboard.targetname="statusbaritem"> <easingdoublekeyframe keytime="0" value=...