Posts

Showing posts from April, 2010

MySQL large requests don't work in AJAX and need LIMIT, while working in straight PHP -

Image
i have mysql table can contain 500 000 rows , calling them on site without limit clause; when without ajax, works normally, ajax , again without setting limit, no data returned. checked ajax code , there no mistake there. thing , when write limit, example 45 000 , works perfectly; above this, ajax returns nothing. with limit witohut limit : can ajax issue because found nothing similar on web or else? edit here sql request select ans.*, quest.inversion, t.wave_id, t.region_id, t.branch_id, quest.block, quest.saleschannelid, b.division, b.regionsid, quest.yes, quest.no cms_vtb ans left join cms_vtb_question quest on ans.question_id=quest.id left join cms_task t on t.id=ans.task_id left join cms_wave w on w.id=t.wave_id left join cms_branchemployees b on b.id=t.branchemployees_id t.publish='1' , t.concurent_id='' , ans.answer<>'3' , w.publish='1' , quest.questhide<>1 order t.concurent_id desc limit 44115 the php : var ur

asp classic - Download Excel not working properly in ASP -

i new asp.i need write script download excel in asp.i tried downloading entire page content need download table database. here code: <%@language="vbscript"%> <form name="form1" id="form1" method="post"> <input type="hidden" name="action" value="sel"> <table> <tr> <td><input type="submit" name="submit" id="submit" value="download excel"></td> </tr> </table> hello world <% action = request.form("action") if action="sel" response.contenttype = "application/octet-stream" response.contenttype = "application/vnd.ms-excel" set conn = server.createobject("adodb.connection") conn.open "provider=sqloledb;data source=10.1.1.1;uid=sa;pwd=root;database=student" dim conn,rs

How to relate geofence with the database in my android device? -

i pretty new android app development , develop app geofencing. under understanding, geofencing can related own database stored in device memory , has limitation 100 geofencing can used @ same time. (actually not sure if understanding right. if not, please correct me.) my question is: can store several lists of geofences in device , enable list want using app? so, can have more 100 geofences use less 100 @ same time. short answer: yes, can. i'm not sure exact space requirements don't see problem in saving several lists of 100 entries each. for more information on how save data in android i'd recommend looking @ this training module . don't have save data - keep in working memory , redownload lists every time. maybe make more sense in case, don't know.

google dfp - How to track impressions and clicks in two DFP accounts? -

i track impressions , clicks same creative in 2 dfp accounts. did following steps: in first account (a) created creative of type image. in second dfp account (b). created third-party creative , inserted code creative account (a), following: <a href='%%click_url_unesc%%https://www.example.com/' target='_blank' > [dfp generated code image creative in account a] </a> the problem tracking not working, in creative of type image. after searching found possible via tracking lineitem available in dfp premium, whereas have dfp small businesses. i tried following: * in field third-party impression url in creative of type image, put url opens third-party creative when url requested browser: http://www.example.com/service/cookie.dfp.php?networkid=[network-id]&lineitem=[line-itme]&adunit=[ad-unit]&width=[width]&height=[height] this url should pinged each creative of type image impression, unfortunately no impressions registered in third-p

c# - Wait on function to complete -

in 1 of functions i'm getting document: controller.retrievedocument(documentid); // here want work after document has finished loading this how function build up: public async void retrievedocument(string documentid){ documentresult documentresult = await getdocumenttask (documentid); // checks here } the called function this: private async task<documentresult> getdocumenttask (string documentid){ try{ loadingspinner.show(); documentresult = await task.run(() => manager.getdocument (documentid)); loadingspinner.hide(); } catch(exception ex) { // } } now want if retrievedocument has been finished other work. problem retrievedocument asynchronous , other code executed before function has finished loading. there 2 options comes mind: wait on retrievedocument somehow. make synchronous. use separate event in retrievedocument i don't know how should wait on retrievedocument described in

Why CSS hover effect with class selector does not work with nested layout? -

simple code. jsfiddle <!doctype html> <html> <head> <meta charset="utf-8" /> <title></title> <link rel="stylesheet" type="text/css" href="css/normalize.css"/> <link rel="stylesheet" type="text/css" href="css/style.css"/> </head> <body> <div class="header"> <div class="nav"> <div class="navtitle">1</div> <div class="subnav subnav1">test1</div> <div class="subnav subnav2">test2</div> <div class="subnav subnav3">test3</div> <div class="subnav subnav4">test4</div> </div> </div> <div class="container"> </di

I am trying to convert the following objective-c code to swift: -

svksharedialogcontroller * sharedialog = [vksharedialogcontroller new]; sharedialog.text = @"your share text here"; sharedialog.otherattachmentsstrings = @[@"https://vk.com/dev/ios_sdk"]; [sharedialog presentin:self]; //swift var sharedialog = vksharedialogcontroller() sharedialog.text = "your share text here" sharedialog.otherattachmentsstrings = ["https://vk.com/dev/ios_sdk"] but errors saying type "viewcontroller" not conform protocol "vksdkdelegate". how can fix issue? the error because adopting vksdkdelegate protocol in viewcontroller class, have not implemented 1 or more of required methods. vksdkdelegate reference lists required methods have implement in class.

ember.js - Hiding parent view in Master/Detail pattern -

i building mobile-first app therefore needs quite economic screen real-estate , there cases when navigating between resource , 1 of it's sub-routes want able have subroute take place of {{outlet}} @ same time remove parent view/template's dom elements. if route set as: router.map(function() { this.resource('workouts', function() { this.route('workout', { path: '/:id' }, function() { this.resource('exercises', function() { this.route('new'); this.route('exercise', { path: '/:id' }); }); }); } } and let's wanted start browsing looking @ specific workout ("1234") list of exercises undertook in workout without details. navigate to: http://best.app.ever/workouts/1234 and when clicked on particular exercise i'd want see details of exercise ("123") at: http://best.app.ever/workouts/1234/exercises/123

memory - Python str view -

i have huge str of ~1gb in length: >>> len(l) 1073741824 i need take many pieces of string specific indexes until end of string. in c i'd do: char* l = ...; char* p1 = l + start1; char* p2 = l + start2; ... but in python, slicing string creates new str instance using more memory: >>> id(l) 140613333131280 >>> p1 = l[10:] >>> id(p1) 140612259385360 to save memory, how create str-like object in fact pointer original l? edit : have buffer , memoryview in python 2 , python 3, memoryview not exhibit same interface str or bytes : >>> l = b"0" * 1000 >>> = memoryview(l) >>> b = memoryview(l) >>> < b traceback (most recent call last): file "<stdin>", line 1, in <module> typeerror: unorderable types: memoryview() < memoryview() >>> type(b'') <class 'bytes'> >>> b'' < b'' false >>> b'

java - Resuming current background activity on notification -

my application contains multiple activities. have implemented push notifications , shown notification in bar. issue is, when click on notification take me specific activity has specified. intent intent =new intent(gcmservice.this, mainactivity.class); pendingintent pendingintent = pendingintent.getactivity(gcmservice.this, 0, intent, 0); notificationcompat.builder notificationbuilder = new notificationcompat.builder( getapplicationcontext()) .setcontenttitle(getresources().getstring(r.string.app_name)) .setautocancel(true) .setcontentintent(pendingintent); notificationbuilder.setcontentintent(pendingintent); mnotificationmanager.notify((int) when, notificationbuilder.build()); i want if activity in background, , user click on notification app resume current activity in background , show dialog box. , if application closed. open launching activity , show dialog box. if want continue again when click

Android - is there any way to change WiFi signal to 5GHz? -

my problem first: when use wifi , bluetooth @ same time wifi becomes "unstable" , wifi drops down. basic problem here: wifi , bt use same frequency, 2.4 ghz. is there way fix that, or way change wifi use 5ghz signal? thanks if have ap has both 2.4ghz , 5ghz , both set same ssid, i'm not sure can specify use 1 on other (at least, can't seem on phone). can specify different ssid's different radios looks 2 access points , can connect 5ghz one. know can openwrt, lot of stock router firmwares may not allow this. you should able bt , wifi @ same time if they're both @ 2.4ghz provided hardware/software has proper set co-exist. have used cheaper hardware despite having drivers 2 co-exist, don't seem able both work @ same time (one gets cut off). i'm not sure if can different connection managers android, if find 1 can specify bssid specify connect 5ghz radio on router.

linux - C++: how to get input using two kind of ways,like cin and file? -

i have written c++ program can info file, must support 2 ways of reading data. the first way passing filename command line parameter: ./a.out a.txt the second 1 reading pipe: cat a.txt | ./a.out the second way more important , more difficult me. how can done? here detail question: there class,which defined this: class api_export samreader{ // constructor / destructor public: samreader(void); ~samreader(void); // closes current sam file bool close(void); // returns filename of current sam file const std::string getfilename(void) const; // return if sam file open reading bool isopen(void) const; // opens sam file // *** here is question bool open(const std::string& filename); bool open(std::istream cin); //here~~~~ // retrives next available alignment bool loadnextalignment(bamalignment& alignment); private: internal::samreaderprivate * d; }; i have got way input file , result, need add func in class, make can input stdin... thanks help,

database - db derby StartNetworkServer -

i have problem starting derby server. derby version: db-derby-10.11.1.1 i followed tutorial: http://db.apache.org/derby/papers/derbytut/ns_intro.html but after typing: startnetworkserver.bat there no response: https://www.dropbox.com/s/bo1tgfj8gf2533i/derby_issue.png?dl=0 could me? maybe there problem localhost? think install derby correctly because after typing: java org.apache.derby.tools.sysinfo got result regards the bug in localization (for me in cs localization) , derby server not print exceptions default. workaround: under windows in console run following commands: set "derby_opts=-duser.language=en -dderby.drda.debug=true" startnetworkserver.bat the first line adds 2 options java/derby . first option change local language en , second 1 enables printing debug messages console. second line runs server (add path if needed). another workaround adding missing localization key drda_missingnetworkjar.s file org\apache\derby\loc\drda\messages

Dynamically resize fragment in android -

Image
i have fragment fill of screen. now, if add new fragment each fragment fill half of screen. how can this? i tried layout , programmatically added fragments. doesn't work. <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:paddingbottom="@dimen/activity_vertical_margin" tools:context="tech.test.org.game.game$placeholderfragment"> <relativelayout android:id="@+id/relativelayout" android:layout_width="match_parent" android:layout_height="0px" android:layout_weight="50"

Binary combinations of N bits with at most M "1" -

the total number of binary combinations of n bits : 2^n. what formula number of possible binary combinations of n bits following constraint: have @ m "1" in each combination (m < n). thank you! the total number binary combination m "1" combinatorial c(n,m) , think formula c(n,m) + c(n,m-1) + ... + c(n,1) + 1

c# - Why isn't this causing an infinite loop of events? -

i have simple application reverses text typed in textbox. catch is, can modify either textbox , changes (literally) reflected in other. i wrote code, believing cause problems. private void realtext_textchanged(object sender, eventargs e) { mirrortext.text = mirror(realtext.text); } private void mirrortext_textchanged(object sender, eventargs e) { realtext.text = mirror(mirrortext.text); } private string mirror(string text) { return new string(text.reverse().toarray()).replace("\n\r", "\r\n"); } i tried out, believing cause infinite loop ( realtext changes mirrortext , event happens, mirrortext changes realtext , etc). however, nothing except intended behavior happened. i'm of course happy this, leave here. or i? i'm quite sure textchanged event supposed fired whenever text changed. intended behavior of error protection in events, or lucky? can code misbehave on computer, other build settings, etc? can fixed: private void rea

html - how to get textbox value in hyperlink as id? -

hi want fetch value text box , append hyperlink id. here code unable value of textbox. <li><a class="ajax-link" href="ajax/legal_notice.php?id=+ document.getelementbyid('cust_id').value">hypelink name</a></li> <div class="col-sm-6"> customer id </div> <div class="col-sm-6"> <input type="text" name="cust_id" id="cust_id" class="form-control" > </div> kindly guide me how value text box. try this <html> <head> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script> <script type="text/javascript"> alert("hello"); function resetlink(ele) { var href="ajax/legal_notice.php?id="+$(ele).val(); $(".ajax-link").attr("href",&q

regex - How to redirect video to another video? -

how redirect video video ? for example: have 1 video: http://mywebsite.com/video.mp4 and when access 1 of videos below, content of above video showed. how ? thank ! http://mywebsite.com/1.mp4 http://mywebsite.com/2.mp4 http://mywebsite.com/3.mp4 http://mywebsite.com/4.mp4 ... you can use code in document_root/.htaccess file: rewriteengine on rewritebase / rewriterule ^\d+\.mp4$ video.mp4 [l,nc]

google app engine - Appengine search language -

i'm trying implement search.fieldloadsaver interface able pick field language. func (p *product) save() ([]search.field, error) { var fields []search.field // add product.id fields = append(fields, search.field{name: "id", value: search.atom(p.id)}) // add product.name fields = append(fields, search.field{name: "name", value: p.name, language: "en"}) return fields, nil } and i'm getting error : errors.errorstring{s:"search: invalid_request: invalid language . languages should 2 letters."} it seems python devserver handles empty language field error. edit: problem was putting multiple fields same name , setting language empty. appears isn't allowed, when you're using multiple fields same name, make sure you're putting language also. i'm not sure question here can see think ( it seems python devserver handles empty language field error. ) not true. code snippet documentation

Android 5.0 (L) - Check data Roaming Setting -

i have problem identifying data roaming setting in android l. in previous versions of android, able access either settings.secure or settings.global (depending on android version), , setting. but now, on android l, no longer works. whether data roaming on or off, return settings.global 0. android l supports multi sim out of box, so, new manager created handle this: subscriptionmanager. subscription manager, handles several settings of several sim cards in form of subinforecord classes. can retrieve settings per sim card. however, dataroaming filed inside class 0 well. does know how can achieved on new api? my app system app comes embedded in phones factory so, should able access apis available. however, i've spent long time looking in source code found nothing. in settings.global class there's no indication that setting no longer works on android. does have clue on setting moved to? thanks in advance! check devicepolicymanager.setglobalsetting docu

taxonomy - User can use only their category in Wordpress -

i need find solution how allow category edit or use post user create category. need assign author taxonomy. possible this? know posts possible allow users see post. thanks answer. you can create custom new add-post form. in form, if clause filter taxs.

qt - How select an area in QQuickPaintedItem -

i want build selection tool qml image editor. for this, i'm looking similar function setselectedarea in qgraphicsscene . has solution this? greetings edit: maybe can write plugin selection tool extends qquickitem , draw qpolygon opengl. you need implement selection yourself. you can create mousearea track mouse activity , update selected rect accordingly. mean this: documentviewer { // qquickpainteditem id: viewer mousearea { anchors.fill: parent acceptedbuttons: qt.leftbutton property real originx: 0 property real originy: 0 onpressed: { originx = mouse.x originy = mouse.y } onpositionchanged: { var width = mouse.x - originx var height = mouse.y - originy viewer.selectionrect = qt.rect(originx, originy, width, height) } } } then you'll able update and paint selection rectangle in viewer's selectionrect propert

sql server - SQL Update after INNER JOIN two tables -

i update 2 tables on same update statement inner join cant attach second table update t1 set t1.status='test1', t2.status='test1' mytable1 t1 inner join table2 t2 on t1.id=t2.id parameters..... but cant use t2.status='test1' error getting the multi-part identifier "t2.status" not bound. you can't update 2 tables in single update statement, if using join clause. join clause can used "filtering" purposes only. table can updated.

Django + IIS windows server 2008 -

hi trying install django on iis following guide http://www.youtube.com/watch?v=kxbfhtavubc#t=194 @ end error python 3.4 django 1.7.1 windows server 2008r2 iis 7.5 file wsgi.py import os os.environ.setdefault("django_settings_module", "plastimi.settings") from django.core.wsgi import get_wsgi_application application = get_wsgi_application() environment variables name : wsgi_handler value: django.core.wsgi.get_wsgi_application() error occurred while reading wsgi handler: traceback (most recent call last): file "c:\inetpub\wwwroot\django\plastimi\wfastcgi.py", line 711, in main env, handler = read_wsgi_handler(response.physical_path) file "c:\inetpub\wwwroot\django\plastimi\wfastcgi.py", line 568, in read_wsgi_handler return env, get_wsgi_handler(handler_name) file "c:\inetpub\wwwroot\django\plastimi\wfastcgi.py", line 541, in get_wsgi_handler handler = handler() file "c:\python34\

What's the "official" way to integrate Spring into OSGI -

long time ago have been working spring in osgi context. @ time there subproject called spring dynamic modules being first address integration of 2 frameworks. coming scene years later situation not clear anymore (for me). spring dynamic modules has migrated blueprint , there 2 major implementations aries , gemini first 1 seems more in competition spring complementing , latter seems small , rare release cycles. the official spring page has no documentation @ more concerning osgi. so can better standing / know how in spring , tell me what's (11/2014) "official" or preferred way integrate spring applications osgi environment? many & best regards rabe spring not officially support osgi nowadays. spring ebr repository closed (i guess had said close it) , company took on content in virgo ebr repo. not know if still alive. if have choice, not use spring within osgi. great technology, designed work in monoholitic systems. there blog post why not use spr

How to add text to sender ID in kannel -

i sending sms using (http:/ myip:13013/cgi-bin/sendsms?from=xxxx&username=kannel&password=kannel&text=testsms&to=9122222288) in kannel i able send sms successfully. receive sms sender : - xxxx sms body :- testsms in case sender id xxxx. now want add own text sender id eg. xxxx - welcome kannel so changes need in kannel configuration. expected sms: sender : - xxxx - welcome kannel sms body : - testsms your sender id you've specified in from parameter in sendsms url, i.e., here: [...]from= xxxx &username=[...] you don't need change kannel configuration change sender text, change value in url. have take account that: the value should url-encoded . it must between 3-11 alphanumeric characters (letters, numbers , underscore according gsm standard.) in practice other characters work 99% of time. in practice shorter sender ids work depends on sms gateway, recipient operator, , recipient phone. or can 15 digits if it's num

python - Having trouble replacing with -

i need replace 1 symbol in string letter, decoder game, code have created. need develop part of program when inputs symbol , letter replaces symbol letter , saves list, keep doing untill symbols have been replaced create word. the list of encoded words: #+/084&" #3*#%#+ 8%203: ,1$& !-*% .#7&33& #*#71% &-&641'2 #))85 9&330* the list of words uncoded: acquired almanac insult joke hymn gazelle amazon eyebrows affix vellum clues: a# m* n% code: #import section import random import string class game(): def __init__(self): words_open = open('words.txt') self.words = (words_open.read()) self.fixwords = self.words solved_open = open('solved.txt') self.solved = (solved_open.read()) def menu_display(self): #display menu self.menud = (''' menu 1. start game

php - I am getting an "Route not defined error" with my form in Laravel -

i have set form this: <!--registration form--> {{ form::open(array('action' => 'logincontroller@try_login', 'class'=>'login_form', 'id'=>'login_reg_form', 'role' => 'form')) }} {{ form::label('email', 'email address', array('class' => 'email')); }} {{ form::text('email', 'example@gmail.com', array('class' => 'form-control')) }} {{ form::label('password', 'password', array('class' => 'password')); }} {{ form::password('password', array('class' => 'form-control')) }} {{ form::submit('click me!'); }} {{ form::close() }} <!--end form--> pointing login controller. here controller code: class logincontroller extends basecontroller { /** * instantiate new logincontroller instance. */

java ee - WildFly error when deploy ear -

when try deploy ear project, gives me error. here log-wildfly 8.0.0.beta1 server. i've tried various forms of resolution can not find resolution problem. could 1 me? 13:21:26,674 error [org.jboss.msc.service.fail] (msc service thread 1-11) msc000001: failed start service jboss.deployment.subunit."eedemo-ext.ear"."eedemo-extweb.war".post_module: org.jboss.msc.service.startexception in service jboss.deployment.subunit."eedemo-ext.ear"."eedemo-extweb.war".post_module: jbas018733: failed process phase post_module of subdeployment "eedemo-extweb.war" of deployment "eedemo-ext.ear" @ org.jboss.as.server.deployment.deploymentunitphaseservice.start(deploymentunitphaseservice.java:166) [wildfly-server-8.0.0.beta1.jar:8.0.0.beta1] @ org.jboss.msc.service.servicecontrollerimpl$starttask.startservice(servicecontrollerimpl.java:1944) [jboss-msc-1.2.0.beta2.jar:1.2.0.beta2] @ org.jboss.msc.service.servicecontroll

qt - Style QComboBox's sub-control down-arrow when mouse is hovering over the QComboBox via QSS -

i know how style qcombobox when mouse hovering doing: pcombobox->setstylesheet(pcombobox->stylesheet()+qstring(" qcombobox:hover{css style here}")) and know style qcombobox 's sub-control down-arrow's style via: pcombobox->setstylesheet(pcombobox->stylesheet()+qstring(" qcombobox::down-arrow{css style here}")) but don't know how style qcombobox 's sub-control down-arrow when mouse hovering on qcombobox via qss . have idea? i don't know qss powerful enough this(i think no), eventfilter can easy: bool mainwindow::eventfilter(qobject *obj, qevent *event) { if (obj == ui->combobox && event->type() == qevent::enter) { //user enters combobox, apply stylesheet ui->combobox->setstylesheet("qcombobox::down-arrow{background-color: red}"); } else if(event->type() == qevent::leave)//user leaves combobox, set default settings ui->

select other values rather than group by django -

lets take example orderitem.objects.filter(order=order).values('item')\ .annotate(number_sold= count('item'), amount= sum('total')) query return me 3 columns item, number_sold, amount.... if add other columns in values added in group clause. is there way can select other column , cannot appear in group clause no. @ sql level, if it's not in group clause need aggregation performed on it. since you're not specifying aggregation occur on it, needs go in group clause if it's supposed returned. edit: if consider following table table in database: cola | colb | colc 1 | | true 1 | | false 1 | b | true 1 | b | false 2 | | true 2 | | false 2 | b | true 2 | b | false if want max value cola run select max(cola) table; . return 2. however, if specify want column colb returned, system needs know how handle them. otherwise doesn't know ones show, since there 4 rows have value 2 cola

jquery - Show only one hidden div -

i'm hidding 2 divs , want make shown 1 of them in same time. for example if click on first - shows up. click on second , first hides , show second div. <div id="showmenu">click here</div> <div class="menu" style="display: none;"><ul><li>button1</li><li>button2</li><li>button3</li></ul></div> <br><br> <div id="showmenu2">click here</div> <div class="menu2" style="display: none;"><ul><li>button1</li><li>button2</li><li>button3</li></ul></div> $(document).ready(function() { $('#showmenu').click(function() { $('.menu').toggle("slide"); }); }); $(document).ready(function() { $('#showmenu2').click(function() { $('.menu2').toggle("slide");

java - Disable exception handling in Acceleo engine -

in acceleo, when edit , save, say, generate.mtl , acceleo automatically generates generate.java class. java class can call dogenerate method external class generate model-based stuff. however, if there exception during execution, exception handled acceleo engine. i tell acceleo engine not handle exceptions , , realize error occurred. how possible? i've been thinking long time this, without success. last week, ran acceleo in standalone mode, java class instead of using pluging. it made me spend lot of time issues libraries, problems dependencies etc. got (i mean, it's hard work, patient). my surprise: when ran acceleo standalone failed, templates same. having many errors, plugin managing , plugin printing empty string result! running acceleo standalone, errors raise exception , main class prints stacktrace. so, if want manage errors yourself, recommend run standalone but... luck! :) i hope :)

ruby on rails - How show two lines on map using gmaps4rails? -

i'm developing rails app, use google maps , paint car routes. i use gmaps4rails gem drawling line on map, so, have plan car ( array of coordinates car route plan ) , report car ( array of coordinates car route drove ). so, have arrays of coordinates - plan , report, example random points : @plan = [ [12.124, 12,34253], [11.124, 12,34253], ... [8.124, 5.344] ] @report = [ [12.224, 12,64253], [10.124, 12,34253], ... [9.124, 6.345] ] i know how draw 1 line on map, example view 'plan' line on map: %div.container %div.panel.panel-default.col-sm-9 %div.panel-body.row #map.col-sm-12 :javascript handler = gmaps.build('google'); handler.buildmap({ provider: {}, internal: {id: 'map'}}, function(){ polyline = #{raw @plan.to_json} handler.addpolyline(polyline); // , not addpolylines handler.bounds.extend(polyline[0]); handler.bounds.extend(polyline[ polyline.length - 1]); handler.fitmaptobounds(); }); but nee

php - how to make an input date field greater than or equal to another date field using validation in laravel -

hi iam developing application using laravel there way make input date field greater or equal date field using validation. i know can achieve through jquery , have got working, want know whether achievable through laravel validation since laravel has got predefined validations. for example protected $validationrules = array ( 'a' => 'date', 'b' => 'date|(some validation b value greater or equal of 'a')' ); edit if there other approach solve problem using laravel concept please tell me i tried validator::extend('val_date', function ($attribute,$value,$parameters) { return preg_match("between [start date] , dateadd("d", 1, [end date])",$value); }); thanks in advance i had same problem. before , after not work when dates same. here short solution: // 5.1 or newer validator::extend('before_or_equal', function($attribute, $value, $parameters, $validato

java - Trying to derive IPv4 address from given IPv4-mapped IPv6 address -

my problem statement says can receive either ipv4 address or v4-mapped v6 address inetsocketaddress instance. if v4-mapped v6 address i've derive v4 address , use that. i reading javadoc of inetaddresses , says: `technically 1 can create 128bit ipv6 address wire format of "mapped" address, shown above, , transmit in ipv6 packet header. however, java's inetaddress creation methods appear adhere doggedly original intent of "mapped" address: "mapped" addresses return inet4address objects.` i can determine if received address v4-mapped v6 address using 1 methods library this: // input inetsocketaddress socketaddress if (inetaddresses.ismappedipv4address(socketaddress.getaddress().gethostaddress())) { system.out.println("this v4 mapped v6 address"); } as per documentation none of libraries (inetsocketaddress, inetaddress or inetaddresses) provides method deriving ipv4 address such mapped input. mean typ

linq - Sorting by age a list class in c# -

i'm beginner , want create implementation prints user information console, ordered age. i've tried use linq without success. code base: class user { public string name; public string surname; public int age; } interface usersconsumer { public void consume(list<users> collection); } this tried interface: list<user> sorteduserlist = collection.orderbydescending(collection => collection.age).tolist(); you need use different variable name inside lambda expression like: list<user> sorteduserlist = collection.orderbydescending(row => row.age).tolist(); otherwise end error like: a local variable named 'collection' cannot declared in scope because give different meaning 'collection', used in 'parent or current' scope denote else edit: noticed 1 thing: this tried interface: you can't have implementation in interface. interface more of contract, have implement interface in cl

sql server - SQL property from inherited Parent-Child relationship -

your inputs appreciated..!! please have , suggest.. two tables - table1 user(pk) | permission_on usr1 | folder_a usr2 | folder_b usr3 | folder_c and table2 rowaddedtimestamp(pk) | user(pk) | substitute_user | begindate | enddate xxxx1 | usr1 | usr1 | 1-1-2010 | 1-1-2010 xxxx2 | usr2 | usr2 | 1-1-2010 | 1-1-2010 xxxx3 | usr1 | usr2 | 1-1-2010 | 1-1-2012 xxxx4 | usr3 | usr3 | 1-1-2010 | 1-1-2010 xxxx5 | usr2 | usr3 | 1-1-2011 | 1-1-2013 i have tried not getting how exact permission on particular user consideration of substitute user. like if today - 2-2-2011 permission on usr3 - folder_a, folder_b, folder_c folder_c -- direct permission usr3 folder_b -- usr3 substitute of usr2 (between 1-1-2011 1-1-2013) folder_a -- usr2 substitute of usr1 (between 1-1-2010 1-1-2012) 2-2-2012 perm

java - how to add pagination to jsp -

i have jsp hit database , data of table employee_details eill have 5 columns id,name,department,salary,manager. below jsp displaying whole table want add pagination it.can 1 regarding this <%@page import="com.symp.dbutil" import="java.sql.*"%> <html> <head> </head> <body> <% connection con; dbutil db; db=new dbutil(); con=db.getoracleconnection("oracle.jdbc.driver.oracledriver",url,username,password); system.out.println("connection "+con); statement st=con.createstatement(); resultset resultset = st.executequery("select * employee_details") ; %> <table id="results" > <tr> <th>employee_id</th> <th>name</th> <th>salary</th> <th>department</th> <th>manager</th> </tr> <% while(resultse

python - Matplotlib Fill Missing Tic Labels -

Image
i have list of pandas dataframes (example) data frames: df1 = pd.dataframe({'number':[-9,-8,0,1,2,3], 'a':[3,6,4,1,7,19], 'b':[2,4,4,0,7,1]}) df1.set_index('number',inplace=true) df2 = pd.dataframe({'number':[0,5,6,7,8,9], 'a':[8,7,3,5,2,15], 'b':[1,7,1,1,1,3]}) df2.set_index('number',inplace=true) df_list = [df1, df2] #in reality there more 2 in list and trying plot them using matplotlib: nrow = 2 ncol = 2 fig, axs = plt.subplots(nrow,ncol) in range(nrow*ncol): #convert 1d 2d row = / ncol col = % ncol if >= len(df_list): axs[row,col].axis('off') else: df_list[i]['a'].plot(kind='bar', ax=axs[row,col], ylim=(0,20), xlim=(-10,10), figsize=(20,15), color=('green'), legend=false, ) df_list[i]['b'].plot(kind='bar',

facebook api get users tagged_places -

i want know if there way through facebook api information tagged places of friends without asking them permission? furthermore can tagged places of users not in friends list. it seems once possible using /checkin endpoint @ point in time looks method no longer available. taken facebook documentation : this document refers feature removed after graph api v1.0. from changelog , can see feature totally removed: endpoints no longer available in v2.0: ... /me/checkins has been removed, along user_checkins permission. ... further down in document continue list permissions have been removed: all friends_* permissions have been removed. include: ... friends_checkins ... it seems no longer possible access data need. fyi changelog information posted on april 30th, 2014 - it's been while.

c - How to use Format String Attack -

assume have following code: #include <stdio.h> #include <stdlib.h> #include <fcntl.h> int num1 = 0; int main(int argc, char **argv){ double num2; int *ptr = &num1; printf(argv[1]); if (num1== 2527){ printf("well done"); } if(num2 == 4.56) printf("you format string expert"); return 0; } i trying understand how right can't organize mind guides on internet. is suppose like: ./program %p %p %p %p and then ./program $( printf "\xaa\xaa\xaa\xaa") %.2523d%n i can't figure out, please me through it. the main point of exploit string running program through prinft function. need both "well done" , "you format string expert" printed. in case, through linux terminal/shell. hustmphrrr notice: indeed supposed white hacking - software security first of recommend read book hacking: art of exploitation . good. now try explain how can exploit prog

qt - Pyqt5 & QML2 deploy on debian/mint (dev - ubuntu) -

i have pyqt5 application uses qml2 frontend. while migrating developer's (my) machine (mint qiana, debian sid) stucks on importing qtquick.dialogs 1.1 . error can reproduced on fresh docker containers running debian-sid image. my test python script: from pyqt5 import qtwidgets, qtwidgets, qtcore, uic pyqt5.qtcore import pyqtproperty, qcoreapplication, qobject, qurl pyqt5.qtqml import qmlregistertype, qqmlcomponent, qqmlengine class commonqmlwindow(): def __init__(self, qml_file_name): self._engine = qqmlengine() component = qqmlcomponent(self._engine) # stuck here (line below - component.loadurl) component.loadurl(qurl(qml_file_name)) self.qml_window = component.create() if self.qml_window none: error in component.errors(): print(error.tostring()) exit(1) ui import commonqmlwindow loading: from pyqt5 import qtwidgets, qtwidgets, qtcore, uic pyqt5.qtcore import pyqtprop

node.js - How make http.globalAgent.maxSockets works on expressjs? -

i see number of posts on platform giving same solution not work me, here simple node program understand why still appears process requests 6 6 instead of setup in http.globalagent.maxsockets ? var http = require('http'); http.globalagent.maxsockets = 10; var express = require('express'); var app = express(); app.use('/', function(req, res, next){ console.log('request /'); settimeout(function(){ res.send('ok'); console.log('handled'); }, 2000); }); app.listen(3309); console.log('server up.'); thank much... it's not clear problem try solve, http.globalagent singleton http client , can't affect code in way.

jQuery datatables delete rows but only the ones which are dynamically added -

i have followed post( http://sebastiandahlgren.se/2013/07/27/adding-lines-to-table-with-jquery/ ) , implemented add row , delete row functionality in jsp page. everything working fine except 1 problem. delete row button deletes row loaded during page load (say 30 rows). here code snippet function deleterow () { if (count != 1) { $("table#mytable").datatable().fndeleterow(count - 1); count--; } } i want allow rows dynamically added using addrow function of datatables plugin. how can issue solved. you'll need distinguish between pre-loaded rows , ones added dynamically in js code. possible solution add custom css class dynamically added rows only: function addrow() { var table = $('table#mytable').datatable(); table.fnadddata( [ '<input type="text" name="first_name_' + count + '">', '<input type="text" name="last_name_' +

python - numpy sort top bottom -

i trying pull top 5%, bottom 5% , remaining out separate arrays , save average. code below. tg = 48000000 element float array tg.sort() pct = int(tg.size*0.05) high5 = tg[-pct:].mean() low5 = tg[:pct].mean() mid90 = tg[pct:-pct].mean() i'd appreciate suggestions on how speed up. actually don't need sort array. use partition method: tg = 48000000 element float array pct = int(tg.size*0.05) tg.partition([pct, tg.size - pct]) mean_low5 = tg[:pct].mean() mean_high5 = tg[-pct:].mean() mean_mid90 = tg[pct:-pct].mean() (code updated according jaime' comment)

c# - Why the ItemsControl doesn't show all -

i have itemscontrol. <dockpanel height="280"> <border cornerradius="6" borderbrush="gray" background="lightgray" borderthickness="2" > <scrollviewer verticalscrollbarvisibility="auto"> <itemscontrol height="400" name="ictodolist" itemssource="{binding items}"> <itemscontrol.itemtemplate> <datatemplate> <grid name="todolist"> <grid.rowdefinitions> <rowdefinition height="*"/> <rowdefinition height="*"/> <rowdefinition height="*"/> <rowdefinition height="*"/> &