Posts

Showing posts from March, 2010

java - homework: to circular shift an unknown sized linked list without looping over its elements more than once and without creating a duplicate list? -

i got java assignment: i receive singly linked list head. allowed iterate on list once, , not duplicate it. receive positive integer n may bigger (unknown) list size. (the last node's 'next' field refers null) list must circular shifted n times, without duplicated operations. need return new head node. example n=5: 1 2 3 4 5 6 7 8 9 -> turns into 6 7 8 9 1 2 3 4 5 i fail see how possible when n bigger list size.. in advance when n bigger array size should start @ 0 again. it'd same if write: n=n%arraysize;

batch file - Windows Bitsadmin Alternative -

because bitsadmin getting deprecated hear if know alternative download files within batch script. best alternative comes windows don't need download stuff. bacon bits , had same idea @ same time. here's example using powershell's bitstransfer module. save .bat file , run it. @echo off setlocal set "url=http://cdn.sstatic.net/stackoverflow/img/sprites.svg" set "saveas=sprites.svg" powershell "import-module bitstransfer; start-bitstransfer '%url%' '%saveas%'"

c# - Open downloads in FileOpenPicker on Window Phone 8.1 -

i trying set suggested location fileopenpicker. here how did this: var openpicker = new fileopenpicker(); openpicker.suggestedstartlocation = pickerlocationid.downloads; openpicker.filetypefilter.add("*"); it working fine on winrt , getting directly downloads folder. on windows phone it's don't working. instead of getting downloads showing list of default folders pick. after time fixing problem found, if i'll set filetypefilter that: var openpicker = new fileopenpicker(); openpicker.suggestedstartlocation = pickerlocationid.musiclibrary; openpicker.filetypefilter.add(".jpg"); it open picturelibrary . funny thing, don't metter setting suggestedstartlocation , picturelibrary . has faced problem before? appreciate advice! suggestedstartlocation -- suggestion. can't use force file picker open location. example if user navigated location , opened file there, file picker start there. little problematic testing, intuitive user.

ios - NSCaseInsensitiveSearch RangeOfString search Swift -

i'm attempting write following code in swift, having trouble doing so: objective - c: nsarray * seacharray = [sessionsearchresults filteredarrayusingpredicate:[nspredicate predicatewithblock:^bool(productmodel* evaluatedobject, nsdictionary *bindings) { return [evaluatedobject.productname rangeofstring:searchstring options:nscaseinsensitivesearch].location != nsnotfound; }]]; swift (what have far) func searchdisplaycontroller(controller: uisearchdisplaycontroller, shouldreloadtableforsearchstring searchstring: string!) -> bool { let filteredarray = searcharray.filter { (session: productmodel) -> bool in //contains string? return session.productname == searchstring } var s : string s in filteredarray { println(s) } return true } just curious. there away achieve without importing foundation? short answer: no. swift has straightforward bridging between it's classes , foundation classes, e.g.

c++ - Why is one expression constant, but not the other? -

why visual studio 2013 compiler reject first static assert (error c2057), not second? #include <limits> typedef int frequency; const frequency minhz{ 0 }; const frequency maxhz{ std::numeric_limits<frequency>::max() }; const frequency invalidhz{ -1 }; static_assert(minhz < maxhz, "minhz must less maxhz"); // c2057 static_assert(invalidhz < minhz || invalidhz > maxhz, "invalidhz valid"); // ok i'd guess that, in implementation, max() isn't constexpr (as c++11 says should be), maxhz isn't constant expression, while minhz , invalidhz are. thus first assert fails because can't evaluated @ compile time; second succeeds, because comparison before || true, second comparison isn't evaluated.

Why Did My Moodle Due Dates Change -

we have due dates set on of our assignments 11:55pm. noticed of our due dates changed 7:55pm on assignments (the dates stayed same, time changed). happened in of our courses, not isolated single course. so why 4 hour change? double checked server time , correct, profile time set correct well. idea how or why happening? don't want happen. we using moodle 2.8.1

c# - Trim actions for all properties -

i have typical website admin part admin can add many different entities. i, developer, have trim each of them (to prevent enter entities ' status name '. i.e. in validate method ivalidatableobject interface: public class addprojectviewmodel : projectformbaseviewmodel, ivalidatableobject { public int? parentprojectid { get; set; } public ienumerable<validationresult> validate(validationcontext validationcontext) { projectname = projectname.trim(); descriptiontext = descriptiontext.trim(); of course, can in method project adding db or else. if have 10 forms , each form has 2-3 string properties, code little "straight". maybe can recommend other, more "beautiful" approach trim string parameters? i.e. via attribute of property or else? why don't use reflection? var obj = yourobjecttobetrimmed(); foreach(var property in obj.gettype().getproperties().where(x => x.p

android - Button with distinct corners and an Image at centre -

Image
i need button left side rounded corners , right side flat corners. complete rounded corners possible code: <corners android:bottomleftradius="25dp" android:bottomrightradius="25dp" android:topleftradius="25dp" android:toprightradius="25dp"/> resultant image: now need image similar following one: i've tried follwing code:(sorry..this answer.but not reflecting in xml) <corners android:bottomleftradius="25dp" android:bottomrightradius="25dp" android:topleftradius="0dp" android:toprightradius="0dp"/> but not correct one. to centre image tried following code: <button android:layout_width="0dp" android:layout_height="wrap_content" android:background="@drawable/border2" android:layout_weight="0.5"

vscode - Visual Studio Code: How to make sidebar visible by default? -

in visual studio code sidebar collapsed default. want have file list visible. there setting this? i don't have behavior. if exit vscode, vscode save visible state of sidebar. next time open vscode, vscode restore saved visible state.

java - Could not find class 'android.media.AudioAttributes$Builder' -

so i'm implementing playing sounds game i'm working on. game supports api 8 latest 21. i'm using soundpool play , handle sounds seems api 21, have set audioattributes soundpool. i getting following error: 05-15 13:56:48.202 26245-26245/thedronegame.group08.surrey.ac.uk.thedronegame e/dalvikvm﹕ not find class 'android.media.audioattributes$builder', referenced method thedronegame.group08.surrey.ac.uk.thedronegame.sound.initializerecentapisoundpool sound class <pre>package thedronegame.group08.surrey.ac.uk.thedronegame; import android.annotation.targetapi; import android.content.context; import android.media.audioattributes; import android.media.audiomanager; import android.media.soundpool; import android.media.mediaplayer; import android.os.build; import android.util.log; /** * created michael on 19/03/15. */ public class sound { /** * sound pool */ private soundpool soundpool = null; /** * current soun

python - How to change plot from connecting points to vertical sticks? -

Image
the following code create plot connecting points. import numpy np import matplotlib.pyplot plt x = np.arange(0, 5, 0.1); y = np.sin(x) plt.plot(x, y) plt.show() how can change plot vertical sticks instead of connecting points? i.e., change type of plot of following example: thanks. use plt.bar import numpy np import matplotlib.pyplot plt x = np.arange(0, 5, 0.1); y = np.sin(x) plt.bar(x, y, width=0.08,edgecolor='none',color='k',align='center') plt.show()

xml - XPATH help selecting elements -

so have xml database <uni> <!-- subjects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <subjects> <subject code="xyz111"> <title>java housewives</title> <credits>6</credits> <laboratories> <laboratory num="lab1"> <date>12-mar-2009</date> <topics> <topic>variables</topic> <topic>constants</topic> </topics> <description>declarations of variables , constants</description> </laboratory> <laboratory num="lab2"> <date>12-apr-2009</date> <topics> <topic>expressions</topic> </topics> <description>types of expressions</description> </laboratory>

xml - extracting metadata from jpeg2000 images in python -

i'd update metadata in series of jpeg2000 images. , i'd using python. i've looked @ glymur , have been able extract xml etree: import glymur lxml import etree jp2 = glymur.jp2k(file) metaroot = jp2.box[3].xml # 4th element in box contains metadata want fitshdr = metaroot[0] # metadata originated fits header then can tags , tag values: for kw in fitshdr: tag = kw.tag val = fitshdr.findtext(tag) # tags , values my question is: there easier way? seems unnecessarily complicated.

compare - MySQL doesn't exclude query results from other query -

i have experiment db, , try participants wish recontacted except ones participated in 1 specific experiment. query works, except doesn't include participants took part in experiment, include participants took part in experiment , other experiments. excuse sloppy code! select distinct t1.`par_name`, t1.`email`, t1.`comment` `par` t1, `exp` t2, `pie` t3 t1.`par_id` = t3.`par_id` , t3.`exp_id` = t2.`exp_id` , t1.`recontact`!= 'n' , t1.`email`!= " " , t1.`mothertounge` = 'deu' or t1.`mothertounge` = '' , t1.`age` between 18 , 35 , t1.`par_name` not in(select t1.`par_name` `par` t1, `exp` t2, `pie` t3 t1.`par_id` = t3.`par_id` , t3.`exp_id` = t2.`exp_id` , t3.`exp_id` = '15et001') group `par_name`; im not 100% think need enclose joins select distinct t1.`par_name`, t1.`email`, t1.`comment` `par` t1, `exp` t2, `pie` t3 (t1.`par_id` =

.net - How to stop C# form from rendering the controls -

i using bufferedgraphics redraw form. wish redraw form's controls myself, can draw lines wherever want while can still use form designer align controls. i've tried suspendlayout make no use here. code: using system; using system.drawing; using system.windows.forms; public partial class form1 : form { bufferedgraphicscontext context; bufferedgraphics grafx; picturebox pic1, pic2; public form1() { setstyle((controlstyles)(controlstyles.allpaintinginwmpaint | controlstyles.userpaint), true); initializecomponent(); //add picturebox pic1 = new picturebox(); pic1.backcolor = color.black; pic1.setbounds(50, 50, 100, 50); controls.add(pic1); pic2 = new picturebox(); pic2.backcolor = color.gray; pic2.setbounds(75, 50, 50, 100); controls.add(pic2); } private void form1_load(object sender, eventargs e) { context = bufferedgraphicsmanager.current;

javascript - Prevent user enter greater value in textbox -

i have 2 texbox first has start time end second user should enter end time both on format (00:00:00). how can prevent user enter value in second textbox inferior fist one, endtime must superior start time, message should warn him. behold codes: <input type="text" name="starttime" id="starttime" size="30" value="<?php echo $tab['starttime'];?>" readonly="readonly" /></td></tr> <tr><td> <label>end time</label> </td> <td> <input type="text" name="endtime" id="endtime" value="00:00:00" max="23:00" size="30" required pattern="[0-2][0-9]:[0-5][0-9]: [0-5][0-9]" title="please enter end time format (00:00:00),maximum value is: 23: 59: 59"/></td></tr> if start time instance 08:00:00 , user enter 07:00:00 message should pop warn him. thank you

python - Horizontal and vertical scrolling for a Text widget -

i'm looking simple way (possibly through flags) make text widget scroll horizontally, when typed text inside gets out of range. if know way, scrolling vertically to, please let me know. disable word wrap in text widget. text scroll horizontally type past end of line: try: tkinter import * # python 2 except importerror: tkinter import * # python 3 root = tk() t = text(root, wrap=none) t.pack() root.mainloop() vertical scrolling comes free.

docker - Where does dockerized jetty store its logs? -

i'm packaging project docker jetty image , i'm trying access logs, no logs. dockerfile from jetty:9.2.10 maintainer me "me@me.com" add ./target/abc-1.0.0 /var/lib/jetty/webapps/root expose 8080 bash script start docker image: docker pull me/abc docker stop abc docker rm abc docker run --name='abc' -d -p 10908:8080 -v /var/log/abc:/var/log/jetty me/abc:latest the image running, i'm not seeing jetty logs in /var/log . i've tried docker run -it jetty bash , not seeing jetty logs in /var/log either. am missing parameter make jetty output logs or output somewhere other /var/log/jetty ? why aren't seeing logs 2 things note: running docker run -it jetty bash start new container instead of connecting existing daemonized container. and invoke bash instead of starting jetty in container, won't logs either container. so interactive container won't in case. but also... jettylogs disabled anyways also, won&#

Facebook page name not available -

i'm trying register facebook page, i'd name www.facebook.com/xxx so when type on browser www.facebook.com/xxx tells me page i'm looking doesn't exist. but when try create page got: name taken...any idea? facebook "rushy" network. means take while (couple of minutes or hour) create page including www.facebook.com/xxx want. advice wait time sure you'll have it!

javascript - Google map marker click function issue -

i building interactive map google. have lot of map markers when clicked open bootstrap modal content relative location. possible have 1 modal call in script, load content relative marker clicked? thinking write remote html file of different modal contents. right now, have write click function each marker (painstaking), open unique modal. 1 modal, 1 click function relative marker clicked, unique modal contents loaded depending on marker clicked. can done? function initialize() { var map; var mapoptions = { zoom: 8, center: new google.maps.latlng(43.819201,-79.535474), disableui: true }; map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); var commerciallocations = [ ['regan',43.703264,-79.804144], ['lake',43.897239,-78.6594789], ['rowe',43.72277,-80.378554], ['westport',43.649826,-79.6599653], ['vinefresh',42.9556009,-81.6699305] ]; var

having a n by n square matrix calculate the sum of prime elements C -

i have "having n n square matrix calculate sum of prime elements main diagonal". i tried this: #include<stdio.h> int main(){ int a[10][10],i,j,sum=0,m,n; printf("\nenter rows , columns: "); scanf("%d %d",&m,&n); printf("\nenter elements: "); for(i=0;i<m;i++) for(j=0;j<n;j++) scanf("%d",&a[i][j]); printf("\nthe matrix is\n"); for(i=0;i<m;i++){ printf("\n"); for(j=0;j<m;j++){ printf("%d\t",a[i][j]); } } for(i=0;i<m;i++){ for(j=0;j<n;j++){ if(i==j) sum=sum+a[i][j]; } } printf("\n\nsum of diagonal elements: %d",sum); return 0; } if it's fine how calculate sum of prime elements main diagonal? thanks! you should check whether diagonal element prime or not.for should write separate function. for(i=0;i<m;i++){ for(j=0;j<n;j++){ if(i=

python - Multiprocessing pool not working in user defined function -

i wanted implement multiprocessing pool. if bug or mistake not able so. pooling works numpy function while user defined function runs error. import numpy >>> import multiprocessing >>> p = multiprocessing.pool(5) >>> p.map(numpy.sqrt,range(50)) [0.0, 1.0, 1.4142135623730951, 1.7320508075688772, 2.0, 2.2360679774997898, 2.4494897427831779, 2.6457513110645907, 2.8284271247461903, 3.0, 3.1622776601683795, 3.3166247903553998, 3.4641016151377544, 3.6055512754639891, 3.7416573867739413, 3.872983346207417, 4.0, 4.1231056256176606, 4.2426406871192848, 4.358898943540674, 4.4721359549995796, 4.5825756949558398, 4.6904157598234297, 4.7958315233127191, 4.8989794855663558, 5.0, 5.0990195135927845, 5.196152422706632, 5.2915026221291814, 5.3851648071345037, 5.4772255750516612, 5.5677643628300215, 5.6568542494923806, 5.7445626465380286, 5.8309518948453007, 5.9160797830996161, 6.0, 6.0827625302982193, 6.164414002968976, 6.2449979983983983, 6.324555320336759, 6.4031

How to add apache commons collections in Android Studio (Gradle) -

im trying use listutils when ran app got error: caused by: java.lang.classnotfoundexception: didn't find class "org.apache.commons.collections.listutils" on path: dexpathlist[[zip file "/data/app/com.meridianaspect.wiw-2/base.apk"],nativelibrarydirectories=[/vendor/lib, /system/lib]] so guess have import library via gradle somehow, dont know how that? place jar file in libs folder in root of module. file -> project settings. in left side choose module want add lib, in right side choose tab dependencies. in bottom press plus sign , click file dependency. choose jar , sync project

node.js - EC2 amazon run two server on two different sub domain -

hi running application on port 80 on server http://example.com now want run application on domain sub domain on same 80 port http://abc.example.com how can this? you'd updating cname dns records. example http://example.com <=> 123.123.123.123 // server 1 here http://abc.example.com <=> 123.123.123.124 // server 1 or server 2 here it doesn't matter port number use

objective c - Can't set Custom UITableViewCell property - iOS -

first of want apologize bad english. i'm having trouble set properties of custom uitableviewcell (historicocell). when try set property of cell get: signal sigabrt error: -(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { // dequeue cell. historicocell *cell = (historicocell *)[self.tblhistorico dequeuereusablecellwithidentifier:@"cellidentifier" forindexpath:indexpath]; // fetch item nsdictionary *item = [self.dbmanager.arrcolumnnames objectatindex:indexpath.row]; // configure table view cell [cell.lblcodigo settext:[nsstring stringwithformat:@"%@", item[@"codigo"]]]; [cell.btnfavoritar addtarget:self action:@selector(didtapbutton:) forcontrolevents:uicontroleventtouchupinside]; return cell; } i followed lot of tutorials , questions on web stil error. can me? my code: historicocell.h #import <uikit/uikit.h> @interface historicocell : uitableviewcell @property (weak,

java - Parse JSON URL - JSONException Error -

Image
please give me hand here, trying parse json file url. below code used grab file , posted textview want parse tags , use them? private void postdata(final string param, final textview tv) { final requestqueue request = volley.newrequestqueue(this); jsonobject postreq = new jsonobject(request.method.get, url_login, new response.listener<jsonobject>() { @override public void onresponse(jsonobject response) { } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { system.out.println("error [" + error + "]"); } }) { @override public map getheaders() throws authfailureerror { map headers = new hashmap(); headers.put("accept", "application/json"); system.out.println(headers); return headers; } }; request.add(postreq); } an example of json be

Scala list pattern matching in value declaration -

assuming following list of 4 tuples: > def getlist = list( (1,2), (3,4), (5,6), (7,8) ) i want parse 3 sections in new values declaration - the last tuple (l1,l2) , the penultimate tuple (p1,p2) , the rest of list rest . moreover, i'd pattern-match tuples well. example: > val (rest :: (p1, p2) :: (l1, l2) ) = getlist rest = list( (1,2), (3,4) ) p1 = 5 p2 = 6 l1 = 7 l2 = 8 the expected output not work because :: expects list right-side argument. tried several different possibilities such ::: list wrapper. however, haven't managed achieve goal. is possible? don't want reverse list - instead, i'm looking elegant solution applicable value declaration (thus no match please). hope in one-line solution. edit: scala code runner version 2.9.2 you use :+ matcher object: val rest :+ ((p1, p2)) :+ ((l1, l2)) = getlist it's the part of standard library since scala 2.10 for previous version redefine using source

c++ - Templates. adding , getting element char* -

i've got problem template class , using char*. storage elements in class , try add or element ,but segmentation fault appear. possible without class specialisation type char* ? edit 1: let's assume can't change code in main function class , methods, without specialisations. possible handle char* ? ;) #include <iostream> #include <vector> using namespace std; template<class t> class test { public: void additem(t element){ elements.push_back(element); } t getitem(int i){ return elements[i]; } vector<t> elements; }; int main() { char * cpt[]={"tab","tab2","tab3"}; test<char*> test1; test1.additem(cpt[1]); char * item=test1.getitem(0); //segmentation fault // done without specialisation class char* ? item[0]='z'; cout<<item<<endl; for(auto v:test1.elements) cout<<v<<endl; return 0; } my code

java - Is it possible to annotated the interface for a method validation using BeanValidation? -

i have following structure ina project using learn javaee7: bean: @stateless public class mybean implements myinterface{ public string lookup(@notnull string text){ return "found3"; } } interface: public interface myinterface { public string lookup(@notnull string text); } and second bean: public class helloworld { @inject private myinterface bean; public string getmessage() { return bean.lookup(null); } } my server wildfly 8.2. i have lookup method validated when calling it, annotated parameter doesn't accept null. the problem code runs ok when call helloworld.getmessages() (i return value "found3". if copy validation form myinterface mybean, validaiton exception wanted. is possible declare validation in interface? how do that?

c# - Joining Collections and Assigning values -

i have 2 collections , want join them based on key attribute , assign 1 collection's values other. doing in following way var joineddata = collection_one in office.employees join collection_two in newoffice.employees on collection_1.officeid equals collection_two.officeid select new { collection_one, collection_two}; // declare new collection icollection<office.employees> updatedcollection = new list<office.employees>(); // assign new collection_two values collection_one foreach (var item in joineddata.tolist()) { item.collection_one.deleted = item.collection_two.deleted; updatedcollection .add(item.obp); } this not producing right result. join producing more records should inner join. can spot issue ? try left join using defaultifempty() : var updatedcollection = (from collection_one in office.employees collection_two

javascript - Extend a String class in es6 -

i can write following in es5: string.prototype.something=function(){ return this.split(' ').join(''); }; how do same thing in es6 using new features ? ps : know valid es6. wan't know whether there's other way of implementing such functions in es6 shorter ? above function example. in es6 can object.assign() this: object.assign(string.prototype, { something() { return this.split(' ').join(); } }); you can find more info method here . or use defineproperty (i think better here): object.defineproperty(string.prototype, 'something', { value() { return this.split(' ').join(); } }); see docs here . see comment see when use defineproperty vs object.assign() .

ReactJS use requestAnimationFrame to debounce on scroll or resize events worth it? -

is worth use requestanimationframe debounce scroll or resize events if using reactjs dom update. i have overall immutable object going update based on scroll or resize event changes , have reactjs update dom if needed. i tried exact same thing , wasn't able glean performance out of it. instead, absolute best performance came using twitter approach check every 300ms rather binding scroll/resize events. anytime bind scroll/resize events, many browsers slow down lot, if you're not doing much. in situation, lazily loading images, works way better.

Can I use paypal android sdk outside US? -

this question has answer here: paypal android sdk non-us developers 1 answer i have integrated paypal android sdk in application. can user make payment through sdk in usa , other countries depending upon local currency ? the new mobile sdks available in countries rest apis available mentioned in faqs. please see below list of countries , country specific policies/process. https://developer.paypal.com/webapps/developer/docs/integration/direct/rest_api_payment_country_currency_support/

debugging - Equivalent of chrome://inspect/#workers on Opera -

chrome://inspect/#workers debugging page web workers on chrome. what equivalent of page on opera? opera://inspect/#workers one. it's available on opera 30+ stable.

Publisher name of VSTO add-in in outlook add-in list -

i facing issue vsto add-in not displaying publisher name in outlook's add-in dialog. showing <none> . using vs2013 development. tried signing did not work. can please give specific steps it? you need sign add-in own digital signature (not strong name signature). did purchase certificate trusted vendor? see introduction code signing more information in msdn.

Python ImportError using F2py -

i have 2 f90 files want use python, i'm using f2py compile them (together) , result python module, i'm doing this: f2py -c controlparameters.f90 vector.f90 -m test when this, fine, , can use functions , subroutines files python. but now, need use f2py 2 files, adding couple of libraries, -liomp5 or -lzmumps , python module in upper case, when try import python have following error: importerror: /opt/intel/composer_xe_2013.1.117/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.so: undefined symbol: mpi_finalize there libraries cannot used f2py?

php - Symfony2 form doesn't show any errors yet it doesn't display -

good day, have form in sf2 it's bine linked entity , i'm having trouble solving issues it. start form get's displayed write amount of text get's submit if run print_r($_post) in method controller shows me data i've submited if run inside isvalid() i'm not getting , i'm not getting errors , leaves me no idea i'm doing wrong , how fix it. controller: /** * @route("/papetarie/cautare", name="papetarie_search_form") * @template("catalogbundle:default:search_form.html.twig") */ public function showsearchformaction(request $request) { $form = $this->createformbuilder() ->add('keyword', 'text', array( 'label' => 'cautare produs', 'label_attr' => array('class' => 'sr-only'), 'attr' => array( 'placeholder' => 'cautare produs', 'pattern'

php - PDF Generation with Snappy- Laravel -

so, snappy amazing job creating pdfs laravel site. problem login. snappy can pdf pages before login if try pdf url of page appears after login, pdfs login page. must sessions or auth function. knows how pdf pages require authorisation snappy? am not aware passing authentication pdf generation. suggest is, have separate page render required data , generate pdf. example : want generate pdf user profile detail. first need have normal page ask authentication, once authentication done , details fetched, retrieved information send pdf generation page render data.

php - How to import 5 GB MySQL Dump file in phpmyadmin -

i want import sql file of approx 5 gb. causing problem while loading. there way upload without splitting sql file ? i have tried import terminal also many errors. please me on this. most won't able import 5gb database on phpmyadmin. try bigdump . can download here . step mentioned below. download , unzip bigdump.zip on pc. open bigdump.php in text editor, adjust database configuration , dump file encoding. drop old tables on target database if dump doesn’t contain “drop table” (use phpmyadmin). create working directory (e.g. dump) on web server upload bigdump.php , dump files (*.sql or *.gz) via ftp working directory (take care of text mode upload bigdump.php , dump.sql binary mode dump.gz if uploading ms windows). run bigdump.php web browser via url http://www.yourdomain.com/dump/bigdump.php. can select file imported listing of working directory. click “start import” start. bigdump start every next import session automatically if javascript enabled in bro

php - skip title import csv file -

with code import title of excel want skip title while inserting records in database. csv upload file want skip title of columns in import how it's possible know it's possible.. <?php include 'header.php'; include 'footer.php'; if(isset($_post["import"])) { $db= 'ashutosh'; // database name. mysql_select_db($db) or die (mysql_error()); $filename=$_files["file"]["tmp_name"]; if($_files["file"]["size"] > 0) { $file = fopen($filename, "r"); while (($emapdata = fgetcsv($file, 10000, ",")) !== false) { $sql = "insert contact(user_id,contact_1,contact_2,contact_3,email,tin_no,cst_no) values ('$emapdata[1]','$emapdata[2]','$emapdata[3]','$emapdata[4]','$emapdata[5]','$emapdata[6]','$emapdata[7]')"; mysql_query($sql); } fclose($file); echo "<script>";

Support regarding Android WebView SSL trust -

i need regarding ssl trust. loading payment gateway page in webview. post request , passing payload. happening till now.(shown below) mwebview = (android.webkit.webview)control; string payload = "mypayload"; byte[] valtest = encoding.utf8.getbytes(payload.tochararray(0, payload.length)); mwebview.settings.javascriptenabled = true; mwebview.settings.domstorageenabled=true; mwebview.setwebviewclient(new mywebviewclient(this)); mwebview.setwebchromeclient(new chromeclient()); mwebview.posturl("https://mypage", valtest); after filling form , submit getting callback in onreceivedsslerror method of webviewclient class. here ask proceed (as per various forums). once done not getting success callback. need able read javascript values once response webview. not know how achieved. shown below onsslerrorreceived callback method. public override void onreceivedsslerror(android.webkit.webview view, sslerrorhandler handler, android.net.http.sslerror error) {

java - How to tell maven to compile a project as an aspectj project -

my project: src/main/aspects : com |---badmitrii |---trace.aj src/main/java : com |---badmitrii |---app.java i wrote following pom: <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.badmitrii</groupid> <artifactid>aspectj-test</artifactid> <packaging>jar</packaging> <version>1.0-snapshot</version> <name>aspectj-test</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupid>org.aspectj</groupid> <artifactid>aspectjrt</artifactid> <version>1.6.11</version> </dependency> </d

mobile - how to develop function read sms then restore in future by windows phone 8.1? -

my task write application read sms, save file restore in future. can't find document related restore sms. can restore sms window phones. windows phone goes not give apps access sms messages, other drafting , prompting user send message .

python - pandas groupby access last group -

i have pandas dataframe looking this: date info x y b z b x c y i want know last date. in case c. i thought can grouping , sorting date column: df.groupby('date', sort=true) ... , accessing last group. however, there no way of accessing last group one-liner? there better way this? i think over-complicating things. c should enough: df['date'].max()

python - django-user-accounts package does not load the account/signup.html template -

i trying use django-user-accounts package pinax. new django, , stuck @ point, i've been struggling hours still cannot display account/signup page. so, have following line in urls.py: url(r"^account/", include("account.urls")), then, went check in urls.py of account package, , countains line. url(r"^signup/$", signupview.as_view(), name="account_signup"), so, when give address: 127.0.0.1:8000/account/signup/ in browser, think django should give signupview. don't know "as_view()" function does. second argument of url() should function returns htmlresponse. went see in views.py of account package: class signupview has attribute template_name = "account/signup.html" i expect htmlresponse returned signupview.as_view() using template doesnt. instead, got error: typeerror @ / 'str' object not callable request method: request url: http://127.0.0.1:8000/ django version: 1.6.

javascript - enable/disable 'add new' button in jquery jtable -

i using jquery jtable display tables mysql db. in 1 of tables, want user allowed insert 1 row. i.e. disable add new record button once first row inserted. is possible this? i have following structure defined jtable: $('#schooltablecontainer').jtable({ title : 'schools list', paging: true, //enable paging pagesize: 10, //set page size (default: 10) sorting: true, //enable sorting defaultsorting: 'name asc', //set default sorting actions : { listaction : 'controlleradminschool?action=list', createaction : 'controlleradminschool?action=create', updateaction : 'controlleradminschool?action=update', deleteaction : 'controlleradminschool?action=delete' }, fields : { id : { title : 'school id', key : true, list : false }, name : { title : 

performance - Neo4j Match / Retrieving Query taking too much time 25 sec -

my system 8 core , 16 gb ram. still traversing :user nodes takes time around 25 seconds. i set 2 properties in neo4j-wrapper.conf : wrapper.java.initmemory = 6144 wrapper.java.maxmemory = 12288 :user returning fields 15-20; 2-3 indexes (created_at have index) sorting done on created_at desc total 5 million nodes having database size of 8gb :user nodes 4 million. pagination done. per page 10 records fetched. without order gives results in 0.3 seconds. match (u:user) return id(u) id, u.username, u.email, (..15 more fields..), u.created_at created_at order created_at desc skip 0 limit 10 how can reduce response time neo4j server? neo4j.properties can set reduce execution time? i've had luck setting both init memory , max memory same value (so jvm doesn't have resizing) , setting garbage collection. give these values shot in conf file: -xmx4g #max -xms4g #init -xx:+useconcmarksweepg #garbage collector

Android WebView: Insert dynamic URL once -

i'm trying make webview ask user first time insert url , saved , opened automatically on next run. use sharedpreference: sharedpreferences sp = getsharedpreferences(preference_name, context.mode_private); sp.edit().putstring(url, url).commit(); //save sp.getstring(url, null); //load

javascript - Android WebView Load site Issue -

i have url blog site , load android app this webview = (webview) findviewbyid(r.id.webview); webview.getsettings().setjavascriptenabled(true); webview.getsettings().setloadwithoverviewmode(true); webview.getsettings().setusewideviewport(true); webview.loadurl(myurl); webview.setwebviewclient(new customwebviewclient()); customwebviewclient class private class customwebviewclient extends webviewclient { @override public void onpagestarted(webview view, string url, bitmap favicon) { super.onpagestarted(view, url, favicon); showprogressdialog(browseractivity.this); } @override public void onpagefinished(webview view, string url) { hideprogressdialog(browseractivity.this); } } the site loads , displays images on 2 rows. if open blog phone browser , scroll page end, more images loaded automatically. problem if blog opened app shows 2 rows , doesn't load rest of images. can problem? how fix this? webview.getset

android - Intent-filter - Open NEW application, not embedded one -

This summary is not available. Please click here to view the post.

ios - Making Main View Controller Delegate of UITableViewDataSource -

Image
i'm new ios development. main view controller doesn't display cells table view. trying set display 1 cell now. main view controller subclass of uiviewcontroller, , has table view prototype cell well. mainviewcontroller.h file looks below: #import <uikit/uikit.h> @interface mainviewcontroller : uiviewcontroller <uitableviewdatasource> @property (weak, nonatomic) iboutlet uibarbuttonitem *sidebarbutton; @end i made mainvewcontroller delegate of uitableviewdatasource, right idea here? mainviewcontroller.m looks below: #import "mainviewcontroller.h" #import "swrevealviewcontroller.h" @interface mainviewcontroller () @end @implementation mainviewcontroller - (void)viewdidload { [super viewdidload]; self.title = @"home"; swrevealviewcontroller *revealviewcontroller = self.revealviewcontroller; if(revealviewcontroller) { [self.sidebarbutton settarget: self.revealviewcontroller]; [self.sidebar