Posts

Showing posts from August, 2010

ruby on rails 4 - Rendering wrong head with login layout -

can tell me how possibile following layout in rails 4 app # app/views/layout/login.html.erb <!doctype html> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="content-type"> <title>pippo</title> <meta content="yes" name="apple-mobile-web-app-capable"> <meta content="black-translucent" name="apple-mobile-web-app-status-bar-style"> <meta name="viewport" content="initial-scale = 1.0,maximum-scale = 1.0" /> <link href="/assets/login.css" media="all" rel="stylesheet" /> <script src="/assets/login.js"></script> <%= csrf_meta_tags %> </head> <body> <div class="main-content"> <%= yield %> </div> </body> </html> with following controller class sessionscontroller < ...

java - How to Send Data from Ajax to Servlets -

servlet code protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { response.setcontenttype("text/html"); string s = request.getattribute("stopname").tostring(); response.getwriter().write(s); } ajax code function makerequest(i) { var stopname = document.getelementbyid('newstopname' + i).value; var longitude = document.getelementbyid('newlongitude' + i).value; var latitude = document.getelementbyid('newlatitude' + i).value; var description = document.getelementbyid('newstopdesc' + i).value; document.getelementbyid('hidnewstopname' + i).value = stopname; document.getelementbyid('hidnewlongitude' + i).value = longitude; document.getelementbyid('hidnewlatitude' + i).value = latitude; documen...

sql - getting the column name -

Image
i've below html. <!doctype html> <html> <head> <meta charset="utf-8"> <title>untitled document</title> </head> <body> <form name="new" method="post" action="getr.jsp"> <div class="main"> <table width="200" border="1"> <tr> <td>units</td> <td><input type="text" name="units" id="units"></td> </tr> <tr> <td>product type</td> <td><input type="text" name="prodt" id="prodt"></td> </tr> <tr> <td>hours</td> <td><input type="text" name="hours" id="hours"></td> </tr> <tr> <td colspan="2"><input name="submit" type="submit" id...

Mysql PHP won't work -

i have code ill show information database won't work connecta.php code <?php $dbhost = '*'; $dbuser = '*'; $dbpass = 'nq4*jh5!'; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { die('could not connect: ' . mysql_error()); } mysql_select_db('*'); mysql_query("set names utf8"); ?> and source of page have problem <?php $id = $_request['id']; require("../connecta.php"); $sql = 'select mirror_link fallaga_tbl id=\'$id\' '; $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('could not data: ' . mysql_error()); } ?> <!doctype html> <html> <head> <title>zone-p || fallaga mirror</title> <link rel="stylesheet" type=...

sql - How to select rows using outer join -

i have 2 a1 , a2 tables wit single column. a b - - 1 3 2 4 3 5 4 6 i need select records not in b. tried select [a1] left outer join a2 c on a.[a]=c.[b] select 1 , 2 more 1 time, want unique results only, want 1 , 2 only . refereed few links outer join not able understand fully. know silly question new joins. what not in combined distinct you're not getting duplicates select distinct a1 not in (select b a2)

python - see output of print statements on android using kivy - kivy launcher -

Image
i have created program print instructions on stdoutput while running . can see them when execute app on windows when run same app on android device samsung s3 not see output of print statements . sometimes can see .kivy directory on device in same directory program log files contains kivy specific logs ignore print statement outputs . can 1 give advice how use ... use adb logcat output of application, or use 1 of apps available on-line display logs , grep 'python'. detailed steps above:: enable developer options on device (google friend). enable usb debugging . image taken http://androidfannetwork.com/ then connect device pc using usb cable type adb devices in console. should show device (there might prompt asking permissions connect computer). one simpler way use visual indication on widget instead of printing on console. create functions app bubprint from kivy.core.window import window kivy.clock import clock kivy.factory import factory kivy.la...

ios - Does Google Maps causes high live bytes? -

i'm using google maps ios sdk in current application. map view displays lot of markers (about 900). i'm drawing marker 1 image reference per marker already, live bytes in application extremly high (around 45mb). i see in instruments tool glengine of time responsible library. responsible caller allocatewcmemory , glecreatevertexarrayhashobject . 4kb page size of buffer allocated glengine. may check whether gldeletebuffer when not need buffer more.

c - Pointer passing to function -

when use fragment of code, instead of direct calling malloc() init(), error message appears under windows 8. standard message "program ... stopped working". some of programs generate same under windows 8. under linux fine. win8's c language not ansi compatible? file *dumpfile; double *cx; void init_var(double *ptr) { ptr = malloc (l*sizeof(double)); (i=0; i<l; i++) ptr[i] = (double) i; } void init() { // cx = malloc (l*sizeof(double)); // (i=0; i<l; i++) cx[i] = i; init_var(cx); dumpfile = fopen( "dump.txt", "w" ); } upd. aaaaargh. now. you re-assigning functiona argument inside function, doesn't change argument in caller's context. because c call value . you must pass init_var() address of cx in order change it: void init_var(double **ptr) { *ptr = malloc(l * sizeof **ptr); /* ... */ } void init(void) { init_var(&cx); }

android - Get app sqlite database programmatically in file -

i want upload sqlite db file dropbox. before need sqlite db file in code. how can on device? checked on this link, , says user needs root permissions access database. so in short: how can access sqlite database non rooted devices? eg file f = new file("path_to_db_file"); if approach impossible, how can save app database in place able gain access it? please let me know if can explain anything. thank in advance yes can, worked me without root permission: file db = new file("/data/data/your.package/databases/yourdatabasename"); date d = new date(); file file = new file("your_destination.db"); file.setwritable(true); copyfile(new fileinputstream(db), new fileoutputstream(file)); copy file function this, , works in both directions db->file , file->db: public static void copyfile(fileinputstream fromfile, fileoutputstream tofile) throws ioexception { filechannel fromchannel = null; filechannel tochann...

rest - How to use Google Wallet API with JAVA -

i trying use google wallet api in sample project. read google wallet , found there 2 ways use: javascript , android. but want know there rest api call java code , implement google wallet? thanks, surodip go google wallet quick start java page link here , download sample , configure , build sample run , verify sample.

Why are there non generic versions of binary search in Java? -

why there non generic versions of binary search in java? is because don't want crash existing implementations? there of course generic version of binarysearch 1 . the reason why there non-generic overloads performance: value types need boxed (and copied) in order able use generic binarysearch . same goes sort , other algorithms. 1 in fact there’s more 1 generic overload that’s not relevant here.

java - Static Library classes not getting compiled into apk -

i trying build application use of android.mk. application depends on android library have exported .jar file located in application' libs folder. after building application clear library' classes isn't included in apk - have done wrong? local_path:= $(call my-dir) include $(clear_vars) local_module_tags := optional local_static_java_libraries := staticlibrary local_src_files := $(call all-subdir-java-files) local_resource_dir += $(local_path)/res local_resource_dir += packages/apps/staticlibrary/res local_manifest_file := androidmanifest.xml local_package_name := customerservice local_certificate := platform local_proguard_flag_files := proguard.flags include $(build_package) include $(clear_vars) local_prebuilt_static_java_libraries := staticlibrary/staticlibrary.jar include $(build_multi_prebuilt)

javascript - MapBox: Markers not showing clickable cursor on mouseover -

i moving leaflet+cloudmade mapbox , have been doing minor rewrites code necessary. refreshing map , in previous installment easiest add each marker in it's own layer , on refresh remove layers , redraw markers. here current code: function setleafletmarker(lat, lng, icontype, popuphtml) { popuphtml = typeof popuphtml !== 'undefined' ? popuphtml : ""; var lammarker = new l.marker([lat, lng], { icon: icontype }); //.on('click', markerclick); ; markers.push(lammarker); lammarker.bindpopup(popuphtml); map.addlayer(lammarker); } i suspect has problem, when put mouse cursor on marker, stays hand (draggable) instead of changing pointy finger, meaning marker clickable. clicking works fine, it's not intuitive. how change hand pointy finger? ran same problem also. did quick check of css on mapbox site, , seem fix using css rule in sitewide css file (not map specific). able fix problem using same approach, adding sitewide ...

c# - WPF DataGrid CanUserAddRows event -

is there event or command use can invoke object getting added observablecollection before gets added? at moment, once user clicks row in grid, adds collection, need assign properties in c# don't want assign in grid. public void event { // want before canuseraddrow event collection.add(<t>; } you can use datagrid.initializingnewitem event: private void initializingnewitem(object sender, initializingnewitemeventargs e) { //use e.newitem here } from msdn you can set default values new item handling initializingnewitem event , setting values programmatically

Toggle Hide/Show sidebar jQuery not working -

i can't figure out why toggle isn't working in code. should hide sidebar when click on navbutton, doesn't. thank reading question. javascript $('#navbutton').click(function() { $('#sidebar').toggle('slow'); }); html/php (look between < button > < /button> tag. <div id="header"> <button type="button" class="btn btn-default btn-lg"id="navbutton"> <span class="glyphicon glyphicon-align-justify"></span> </button> <div id="title"> <a href="home.php" style="color:#fafafa;text-decoration:none;">trigger</div> <div id="menuinheader"><ul><li><a href="logout.php"><i class="fa fa-external-link fa-fw"></i> logout</a></li><...

angularjs - Reset a $rootScope property on location change in Angular.js -

in application have $rootscope property called $rootscope.currentstatus used set css class on body under circumstances. the problem need reset value default time user leaves current page, don't know can intercept location change. use $routeprovider: app.config(function ($routeprovider, $locationprovider, $httpprovider) { $routeprovider.when('/site/dashboard', { templateurl: '/partials/site/dashboard.html', controller: 'dashboardcntl', resolve: { loggedin: checkloggedin } }); .... }); with many entries. use resolve adding function reset variable i'd have insert in on routing entries. do have other idea? ok, found solution myself, can intercept location change (route change) using code: $scope.$on('$routechangesuccess', function (next, current) { $rootscope.currentstatus = ""; }); so don't have reset variable in of routing entries, reset when...

python - check if it's File -

i have written small code check if it's file. expecting should "yes" print did not get. doing silly mistake. os.listdir(os.getcwd()+"/../py") = ['a.py', 'a.pyc'] >>> _a in a: ... if os.path.isfile(_a): ... print "yes" you need provide full path ; providing relative path, python looks in current working directory these , there no file named a.py in os.getcwd() . start storing path other directory in variable: path = os.path.abspath('../py') name in os.listdir(path): if os.path.isfile(os.path.join(path, name): print "yes", name, "is file!" i used os.path.abspath() instead of os.getcwd() turn relative path normalized absolute path, , used os.path.join() use path construct absolute paths list of names os.listdir() returned.

Is there an equivalent to ASP.NET WEB API in JAVA world? -

i've been .net web developer several years now, working asp.net web forms , c#, wcf etc.but developed touch enabled customer facing application. device-agnostic application designed platform capable of running html5 applications (ios, android, windows8), mobile devices (such tablets), assisted or unassisted kiosks, laptop or desktop computers. we used asp.net webapi, asp.net mvc 4.0 framework, jquery mobile libraries, html 5, signal r development. is possible migrate or convert complete server side code(i.e controllers methods) under java? does apache tomcat server or (webspehere) supports verbs put, delete inaddition , post? any thing available in java world equivalent asp.net signalr functionality? what required softwares or libraries developing device aganostic touch enabled applications in java? i think web api objectively wins out on other apis in below few key areas. content negotiation, flexibility, separation of concerns how extent spring mvc api or je...

c# - no http-connection possible after occurrence of server error 503 -

i build windows-mobile 6.5 application (based on cf 2.0) , have problem special test case of 1 method. hope can give me advice or has helpful idea reason behaviour is... the method called continuous every 30 seconds inside thread, looks files transferred via http request web server (jboss) , brings them on way. server url under control. everything works fine ... until stop web server , force 503 server error. far good. after restarting web server, expect, next call of transfer method end in success - not. every further try ends in timeout exception , have restart application make work again. so question is: problem, when want connect uri after earlier try has failed error 503? seems, there cached, hell should be? many every hint have. juergen public static boolean httpuploadfile2(string url, string file) { httpwebrequest requesttoserver = null; webresponse response = null; try { logger.writetologfilecom(string.fo...

javascript - How to send image and data using ajax -

i want change profile information. there 4 input box , 2 input file type. could problem solved javascript without jquery? i can't passing input box value , input file type image using ajax, until code return notice: undefined index: full_name in c:\xampp\htdocs\hate\php\profile-update.php on line 6 ... until notice: undefined index: bg_img in c:\xampp\htdocs\hate\php\profile-update.php on line 15 i think mistake in formdata.append(); and explain .files[0]. can't find in google. html <input type="text" maxlength="20" id="fullname-box" name="full_name" onkeyup="disablesubmit()"> <input type="text" maxlength="20" id="screenname-box" name="screen_name" onkeyup="disablesubmit()"> <input type="text" id="targetname-box" name="target_name"> <textarea maxlength="50" id="desc-box" name="descript...

push notification - Android : Error com.parse.ParseException: at least one ID field (installationId,deviceToken) must be specified in this operation -

i using parse push-notification in our application problem in registration of device, error shown below. there problem ,when send push notification device more 1 notification received device. although have upgraded parse library parse 1.4.1.please me,thanks in advance. error shown when app first time installed: 04-14 14:00:40.004: e/log(26045): socket event: onconnect 04-14 14:00:41.874: e/parsecommandcache(26045): failed run command. 04-14 14:00:41.874: e/parsecommandcache(26045): com.parse.parseexception: @ least 1 id field (installationid,devicetoken) must specified in operation 04-14 14:00:41.874: e/parsecommandcache(26045): @ com.parse.parsecommand$2.then(parsecommand.java:348) 04-14 14:00:41.874: e/parsecommandcache(26045): @ com.parse.task$10.run(task.java:452) 04-14 14:00:41.874: e/parsecommandcache(26045): @ com.parse.task$1.execute(task.java:68) 04-14 14:00:41.874: e/parsecommandcache(26045): @ com.parse.task.completeimmediately(task.java:448) 04-14 ...

ios - How can I get a UILable height dynamically with HTML Content? -

i having 1 query. googled alot not able find out solution. i using 1 api in getting content html string. now want set data uitextview. calculate height of uitextview firstly using cgsize constraint = cgsizemake(width-margin - (6 * 2), 20000.0f); // size of text given cgsize made constraint cgsize size = [lbltitle.text sizewithfont:[uifont fontwithname:custom_font_name size:lbltitle.font.pointsize] constrainedtosize:constraint linebreakmode:nslinebreakbywordwrapping]; int lines = size.height / lbltitle.font.pointsize + 1; [lbltitle setframe: cgrectmake(lbltitle.frame.origin.x,lbltitle.frame.origin.y,width-margin, lbltitle.font.pointsize * lines)]; but when passing html content it's generating height more needed. solution calculate height of uitextview html text. using below code assign html text uitextview. [txtdescription setvalue:data.desc forkey:@"contenttohtmlstring"]; thanks in advance. you may use uiwebview intead of uitext...

create a nested map using hashmap in java to accomplish the nested array but not working -

i want create nested array in php. told not available in java , tell use map , hash map. have tried following accomplish issue list<webelement> address = driver.findelements(by.xpath(addressxpath)); list<webelement> addressprimarylist = driver.findelements(by.xpath(addressprimaryxpath)); list<webelement> addresssecondrylist = driver.findelements(by.xpath(addresssecondryxpath)); list<webelement> addresslocationlist = driver.findelements(by.xpath(addresslocationxpath)); map<string, string> addresses = new hashmap<string, string>(); map<string, string> addressesparent = new hashmap<string, string>(); int totaladd = address.size(); system.out.println("total addresses " + totaladd); (int = 0; < totaladd; i++) { addressesparent.put("'" + + "'", addresses.put("addressprimary", addressprimarylist.get(i).gettext())); addressesparent.put("'...

c# - Two background tasks in a row and loading gif (in)visibility -

i've been banging head on desk while problem. so, setup: have form doing "heavy" operations (data loading, etc...). have thread created on fly perform these (in, let's say, "doworkinbackground" method), , form displays small animated gif meanwhile. detail that, @ start of method, gif made visible, , invisible @ end, both being done asynchronously (to thread safe). problem being @ point of program, have 2 calls doworkinbackground in row, , second 1 seems called before gif made invisible first... therefore, gif remains invisible duration of second call. -general methods // perform thread-safe modification on control protected void addcontrolwork(control c, action a) { if (c.invokerequired) c.begininvoke(new methodinvoker(a)); else a(); } // perform background task, displaying loading gif , disabling other controls protected void doworkinbackground(methodinvoker ) { addcontrolwork(loadingpicture, delegate() { loadingpict...

javascript - PHP Simple HTML DOM Parser for "Generated Source Code" -

from understanding, there 2 types of source code ( generated source code vs source code per page (as describe in here what difference between "source" , "generated source"? ). when use php simple html dom parser ( http://simplehtmldom.sourceforge.net/ ), notice source code . how generated source code ? if not possible using php simple html dom parser , there other ways using php generated source code ? (optional) if not possible using php gebnerated source code , there other ways using javascript it? (optional) updates 1 : reference answer made user shankar damodaran , need change understanding there 3 types of source code follows: actual source code (e.g. php, aspx. applies server-side scripts) source code (the source code before javascript , css applied) generated source code (the source code after javascript , css applied) you can't via php alone, have rely on either selenium or phantom.js , headless browsers render page , ret...

ios - Android - can i open Instagram app on given hashtag? -

i'm working on app have published in app store, making android build. in ios use uri one: instagram://tag?name=myhashtag it opens instagram app, showing grid of photos corelated hashtag. unfortunately, in android, below code doesn't work: intent hashtagintent = new intent(intent.action_view, uri.parse("instagram://tag?name=myhashtag") ); startactivity(hashtagintent); is there method make work? it's not core feature of app, don't want use instagram's api. i worked bit instagram before , figured out how open pic or profile in app. long there no link on instagram website hashtags don't know how totally you. in case, how open pic on instagram app app: intent insta_intent = getpackagemanager().getlaunchintentforpackage("com.instagram.android"); insta_intent.setcomponent(new componentname("com.instagram.android", "com.instagram.android.activity.urlhandleractivity")); insta_intent.setdata(uri.parse(...

java - Hibernate generates error SQL like ".=." -

i have 3 tables in oracle db relationship @manytomany. have 2 significant tables , 1 mappings. i create classes name (if want can show classes) named entities, keywords (i understand naming not correct not project optimizations). i use hibernate version 4.3.4. i write query this: session = hibernateutil.getsessionfactory().opensession(); string sql = "select distinct r rules r, entities e " + " r.entities = e.rules " + " , e in :entities "; query query = session.createquery(sql); query.setparameterlist("entities", entitieslist); list<rules> ruleslist = query.list(); but! hibernate generate strange sql hibernate: select rules0_.rule_id rule_id1_11_, rules0_.rule rule2_11_ rules rules0_, entities entities1_, rules_entities entities2_, entities entities3_, rules_entities rules4_, rules rules5_ rules0_.rule_id=entit...

Bug with the .net-client for google translate? -

anyone else experiencing issues .net-client google translate? seems working long strings try translate short enough fit within get-request. when exceed , client tries post-request instead server returns http status 404. with get-requests uses: https://www.googleapis.com/language/translate/v2 but post-requests uses www.googleapi.com/language/translate/v if try manually go post-url in browser receive 404 well. bug in client? edit: found reported bug in bug tracker couple of days ago. due included next release dotnet-client. http://code.google.com/p/google-api-dotnet-client/issues/detail?id=455&can=1&q=translate&colspec=id%20type%20component%20status%20priority%20milestone%20owner%20summary we working on issue, under review - https://codereview.appspot.com/87170043/ . in meantime can split text want translate no more around 1950 chars (the library doesn't support more 2048 chars in url). take @ https://code.google.com/p/google-api-dotnet-client/sourc...

javascript - Why does my X-axis ticks make a little "jump" on safari with D3.js? -

i have graph on website works fine on chrome, on safari or ie, when of following: -change dataset -change dropdown below blue button -remove or add ticks in "select population" button the ticks on x-axis make little "jump" or "hop" before going new position. never happens on chrome. why this? here link website: http://servers.binf.ku.dk/hemaexplorerbeta/ this code makes bump: svg.select(".x.axis").transition().duration(1500) .call(xaxis) .selectall("text") .style("text-anchor", "end") .attr("transform", function(d) { return "rotate(" + axis_rotation + ")" }); if remove transition().duration() doesn't anymore, doesn't change x-axis fluently either.

Representing dinamyc Euller-Bernoulli beam matrix in matlab? -

Image
how can represent in matlab left matrix dynamically, allowing me grow iterative given n. given n , following code constructs matrix show, provided pattern stays same. n = 5; d(n) = -12; d(1) = 12; d(2:end-1) = 6; b1(n-1) = 6; b1(1:end-1) = -4; b2(n-2) = 4/3; b2(1:end-1) = 1; a1 = b1(end:-1:1); a1(1) = -a1(1); = diag(d) + diag(b1, -1) + diag(b2, -2) + diag(a1, 1) + diag(b2(end:-1:1), 2) output n=5 : a = 12.0000 -6.0000 1.3333 0 0 -4.0000 6.0000 -4.0000 1.0000 0 1.0000 -4.0000 6.0000 -4.0000 1.0000 0 1.0000 -4.0000 6.0000 -4.0000 0 0 1.3333 6.0000 -12.0000 output n=8 : a = 12.0000 -6.0000 1.3333 0 0 0 0 0 -4.0000 6.0000 -4.0000 1.0000 0 0 0 0 1.0000 -4.0000 6.0000 -4.0000 1.0000 0 0 0 0 1.0000 -4.0000 6.0000 -4.0000 ...

How can I fade in new HTML elements with CSS -

this question has answer here: using css fade-in effect on page load 3 answers how possible make new html elements fade in using css without bit of javascript? you can use css transitions here sample code: <style> .swapme img { -webkit-transition: 1s ease-in-out; -moz-transition: 1s ease-in-out; -ms-transition: 1s ease-in-out; -o-transition: 1s ease-in-out; transition: 1s ease-in-out; } .swap1, .swapme:hover .swap2 { -webkit-opacity: 1; -moz-opacity: 1; opacity: 1; } .swapme:hover .swap1, .swap2 { -webkit-opacity: 0; -moz-opacity: 0; opacity: 0; } </style> <div class="swapme"> <img src="http://0.tqn.com/d/webdesign/1/0/d/m/1/jaryth1.jpg" class="swap1" style="position: absolute;"> <img src="http://0.tqn.com/d/webdesign/1/0/e/m/1/jaryth2.jpg" class="swap2"> </...

xcode - Use Github Release model to host application's Sparkle appcast -

can github's release feature used host application's sparkle appcast (rss feed)? goal eliminate need have server involved support application updates. the challenge file's url (referenced xcode project's sufeedurl property) wouldn't consistent across versions: https://github.com/user/foobar/releases/tag/v0.1.0 https://github.com/user/foobar/releases/tag/v0.2.0 is there way this? while haven't yet found way integrate appcast directly github releases, i've been using github pages host appcast avoid need server, said. looks releases.io might creating release notes link sparkle github releases.

spring security - "HTTP Status 401 - Authentication Failed: Incoming SAML message is invalid" with Salesforce as IdP for implementating SSO -

i've implemented sso using spring saml , working fine. worked following idp's till now: 1) idp.ssocircle.com 2) openidp.feide.no now i'm testing salesforce.com identity provider. there no provision upload service provider metadata i've done following configuration settings @ idp: gave entityid , assertion consumer service url. uploaded sp certificate. i've downloaded metadata (idp metadata) follows (hiding sensitive information): <?xml version="1.0" encoding="utf-8"?><md:entitydescriptor xmlns:md="urn:oasis:names:tc:saml:2.0:metadata" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" entityid="https://abc-dev-ed.my.salesforce.com" validuntil="2024-04-11t13:55:57.307z"> <md:idpssodescriptor wantauthnrequestssigned="true" protocolsupportenumeration="urn:oasis:names:tc:saml:2.0:protocol"> <md:keydescriptor use="signing"> <ds:keyinfo> ...

c# - Programming StyleCop rules with instrospector-similar-program -

i in process of developing own stylecop rules enforce coding standards , best practices. because still learning "stylecop way of thinking", wondering if there similar program introspector fxcop , targeted stylecop. is there such program or there sdk-helpfile guide in developing stylecop rules?

android - App Inventor and Web App connectivity -

i have created mobile app using app inventor 2 , and web application using mvc.net4. want 2 connect same database. best way this? you can access mysql database web component of app inventor php script on server, see app inventor - mysql interface

c# - Creating an array from json String variable -

"[\"1454\",\"1455\",\"1456\",\"1457\",\"1458\",\"1459\"]" i getting json string in string variable in action method sending json.stringify. these id's of selected rows jqgrid.. i want create array of id's getting . not want others backslash or forward or double qutes. can pl.help me . how possible in c# controller:: public actionresult exportselecteddata(string selectedrows) { } view code:: function gengraph() { // location.href = "/webreports/batchreport"; var selrowids = $("#list1").jqgrid('getgridparam', 'selarrrow'); var array = json.stringify(selrowids); $.ajax({ type: 'post', url: '/webreports/exportselecteddata', data: "{'selectedrows':'" + array + "'}", contenttype: 'application/json; charset=utf-8', ...

java - how can I access the values of XML nodes using DOM API -

i trying access values in xml document dom parser , getting strange null pointer exception error. code using is: import java.io.file; import javax.xml.parsers.documentbuilder; import javax.xml.parsers.documentbuilderfactory; import org.w3c.dom.document; import org.w3c.dom.node; public class readxml { public static void main(string[] args) { file file = new file("c:\\users\\manolaki\\desktop\\assets.xml"); try { documentbuilder builder = documentbuilderfactory.newinstance().newdocumentbuilder(); document doc = builder.parse(file); doc.getdocumentelement().normalize(); node node = doc.getelementsbytagname("assets").item(0).getchildnodes().item(1).getchildnodes().item(1).getattributes().getnameditem("src"); string boo = node.getnodevalue(); system.out.println("name " + boo); } catch (exception e) { e.printstacktrace(); } } ...

linux - Apache Configure Multiple Site on same IP, to be access remotely -

i have vps server. lamp installed in it. consider ip 99.88.77.66 i want run 2 application on site. 1 vtiger , other redmine. installation location redmine: /var/www/html/redmine vtiger: /var/www/html/vtigercrm i configured httpd.conf as.. servername 99.88.77.66:80 .. documentroot "/var/www/html" .. <directory "/var/www/html"> .. namevirtualhost *:80 .. <virtualhost *:80> documentroot "/var/www/html" </virtualhost> <virtualhost *:80> documentroot "/var/www/html/redmine/public" servername localhost serveralias redmine </virtualhost> <virtualhost *:80> documentroot "/var/www/html/vtigercrm" servername localhost serveralias vtiger </virtualhost> /etc/hosts as.. 127.0.0.1 redmine 127.0.0.1 vtiger 127.0.0.1 localhost please me configure in such way that, access http://99.88.77.66/redmine -- able access redmine , http:...

php - How to add any text box after every 5 latest posts in wordpress -

i have updated 20 posts in wordpress theme. , need add own text box after every 5 posts. can add 4 text box after every 5 post. think can done $post_counter please 1 give me query question. my code seems to, <?php query_posts( array('posts_per_page'=>20,orderby=>post_date, order=>desc) ); while ( have_posts() ) : the_post(); ?> <?php the_title(); ?> <?php the_post_thumbnail(); ?> <?php endwhile; ?> i read comment , updated @zameerkhan code. <?php $query = new wp_query( array('posts_per_page' => 20, orderby => post_date, order => desc) ); $p = 1; while ( $query->have_posts() ) : $query->the_post(); ?> <?php the_title(); ?> <?php the_post_thumbnail(); ?> //this create text box after 5 post name mytext1,mytext2 etc. <?php echo ($p%5 == 0) ? '<input type="text" name="mytext'.($p/5).'" />': ""; $p++; ?> <?php endwhile; ?> ...

javascript - How to get an element by its data-itemindex? -

suppose want innerhtml of below <li> data-itemindex. don't know possible or not. <li id="li:90" class="ligrid" data-itemindex="3" data-itemid="li:90" > winoria</li> i tried alert($("li").find("[data-itemindex=3]").html()); alert($("li[data-itemindex='3']").text()); from how select elements jquery have value in data attribute array doesnt me. use css tag selector locate matching element/s within dom: $("[data-itemindex=3]") you can more advanced selectors using similar syntax: [title~=flower] /* selects elements title attribute containing word "flower" */ [lang|=en] /* selects elements lang attribute value starting "en" */ a[src$=".pdf"] /* selects every <a> element src attribute value ends ".pdf" */ a[src^="https"] /* selects every <a> element src attribute value begins "https...

java - Retrieve Luence Index using Solrj -

in application, need find out term occurred in documents. fine if have find out 1 term, have find out "map" terms. example below clarifies looking : i want find out (please consider have field "article_text" text type general ) : index going (as per understandings) : term : doc ids in term found akshay : 1, 2, 3 russia : 4, 5,6 japan : 23,54,21 . . , on. trying retrieve kind of map application. field "article_text" multivalued. want retrieve kind of map terms in 1 query. in related note, great know if can such index of tf.idf using solrj.

javascript - Select multiple li's and it's first child using jquery -

am trying add onclick event tag of particular li 's under ul id #nav . html structure: <ul id="nav"> <li><a href="#">link1</a></li> <li> <a href="#">link2</a> <ul> <li><a href="#">innerlink1</a></li> <li><a href="#">innerlink2</a></li> </ul> </li> <li><a href="#">link3</a></li> <li> <a href="#">link4</a> <ul> <li><a href="#">innerlink1</a></li> <li><a href="#">innerlink2</a></li> </ul> </li> </ul> jquery $( document ).ready(function() { $("ul#nav li").eq(1).children().first().click(function(){ $(this).attr('oncli...

objective c - remove NSDictionary from NSArray in ios -

i have array ( { "can_remove" = 0; date = "april 12, 2014"; "date_created" = "12-04-2014 04:15:19"; id = 18; "is_connected" = 0; name = "j j"; status = first; time = "04:15 am"; "user_id" = 94; }, { "can_remove" = 0; date = "april 12, 2014"; "date_created" = "12-04-2014 02:55:02"; id = 16; "is_connected" = 0; name = abc; status = ""; time = "02:55 am"; "user_id" = 89; } ); mean array contains multiple dictionary object how can delete dictionary array? help me solve this.... thanks.... you can remove objects array if nsmutablearray . can create...

c# - Updating a mappin reference in EF 4.0 -

to begin i'm not sure if it's called mappin reference. have 2 tables important information , 1 table in between them. follows: create table customer ( id int not null identity(1,1), -- pk number varhcar(255) not null, ) .... create table category ( id int not null identity(1,1), -- pk type int not null, -- defines different category types number varchar(50) not null, name varchar(255) not null ) .... create table customercategories ( fk_customer int not null, -- references customer fk_category int not null -- references category ) .... unique (fk_customer, fk_category) in model, customer can have several categories (as long category.type different). it might this: customer: id| number 3 | 10000 category: id|type|number |name 52| 1 | prio_h |high 53| 2 | reg | region south customercategories: fk_customer | fk_category 3 | 52 3 | 53 in c# application put categories in grid...

sql - How to convert multiple rows (in excel) in single sheet into multiple CSV file -

i want convert multiple rows(according group) multiple csv. single sheet in excel contain 3000 rows , 5 columns. want each group excel sheet converts csv file. for example 1 ali khan ali.khan@hotmail.com a1 2 juliet ibm juliet.ibm@hotmail.com a1 3 laura ann lura.ann@hotmail.com b1 4 abcd ewqa abcd.ewqa@hotmail.com b1 5 annia franics annia.franics@hotmail.com c1 now want extract these rows separate csv based on group (a1,b1,c1...). each group creates new csv. just need solution this. doesn't matter if suggest free tool or code. using code copy , paste in sheet , create csv files. dim rowst integer dim rowls integer dim strii string dim stril string rowst = 4 rowls = 4 strii = range("f" & rowls).value stril = range("f" & rowls).value while range("f" & rowls).value <> "" stril = range("f" & rowls).value if s...