Posts

Showing posts from February, 2011

php - Page glitches unless error_reporting is -1? -

on site, if error_reporting not -1, page entirely glitches out i made 2 pages, both same except testblog.php has error_reporting(0);, whereas blog.php has error_reporting(-1); these pages: http://pirates-online-rewritten.com/blog.php http://pirates-online-rewritten.com/testblog.php this code (please fix format someone, don't know how): <?php include "header2.php"; include "connect.php"; error_reporting(-1); $id = mysql_real_escape_string(strip_tags(stripslashes($_get['id']))); $getpost = mysql_query("select * blogs id='$id'"); $gp = mysql_fetch_object($getpost); ?> <table border="0" cellpadding="0" cellspacing="0" width="626" summary="layout table"> <tr> <td valign="top" width="626"> <!-- begin center content --> <table border="0"

node.js - Cordova run ubuntu not work -

i installed ubuntu 14.04 , can not run application using "cordova run ubuntu", gives following error : paulo@paulo-notebook:~/hello$ sudo cordova run ubuntu referenceerror: name not defined @ object.configparser.setdescription (/usr/local/lib/node_modules/cordova/src/configparser.js:70:45) @ object.module.exports.update_from_config (/usr/local/lib/node_modules/cordova/src/metadata/ubuntu_parser.js:74:21) @ object.module.exports.update_project (/usr/local/lib/node_modules/cordova/src/metadata/ubuntu_parser.js:156:21) @ /usr/local/lib/node_modules/cordova/src/prepare.js:113:31 @ _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54) @ self.promisedispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30) @ promise.promise.promisedispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13) @ /usr/local/lib/node_modules/cordova/node_modules/q/q.js:821:14 @ flush (/usr/local/lib/node_mo

c# - Securing client side json -

i new in windows store apps development. creating windows store app requires store data on client side. data present in json format having build action content. whenever user runs application, initializing objects reading json file. plain text , contains data should not revealed user. can encrypt json means. need workaround encrypt json data while building application , decrypt json while reading , initializing objects. please suggest. i'm assuming code looks this: string json = file.readalltext("/<path json>/config.json"); // parse json ... you can encrypt content of json file using aes encryption. need define key used encryption , decryption. take in here : using aes encrypt / decrypt in c# after using encryption code this: when need read configuration: string encryptedjson = file.readalltext("/<path json>/config.json"); string aeskey = "<your aes key>"; string plainjson = aesdecrypt(encryptedjson, aeskey

google play - Android app not compatible with ASUS NEXUS 7 -

i received feedback published app user asus nexus 7 tablet: google play store says app not compatible device. i can't figure out why, believe nexus 7 has app needs, i'm missing something. here relevant manifest snippet: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="xxx.xxxxxxxxx.xxxxxxxxxx" android:versioncode="3" android:versionname="2.1" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="18" /> <uses-feature android:glesversion="0x00020000" android:required="true" /> <uses-feature android:name="android.hardware.location" android:required="true" /> <uses-feature android:name="android.hardware.location.gps" android:required="fal

jquery - How to hide jpanelmenu after load page -

please go fiddle . want hide jpanel after load page. how can that? here code fiddle . jquery $(document).ready(function () { var jpm = $.jpanelmenu({ menu: '#menu', trigger: '.menu-trigger', duration: 300 }); jpm.on(); $(".menu").click(function(){ var url = $(this).attr("link"); alert(url); $( "#contents" ).load(url+" #area"); }); }); have tried this: $(document).ready(function () { var jpm = $.jpanelmenu({ menu: '#menu', trigger: '.menu-trigger', duration: 300 }); jpm.on(); $(".menu").click(function(){ var url = $(this).attr("link"); alert(url); $( "#contents" ).load(url+" #area"); jpm.close();//add line }); });

python - Recording video from raspberry pi and saving it to a external hard drive -

i have raspberry pi model b, , raspberry pi camera module i have either 3tb external hard drive or apple time capsule what want able record video remotely (via ssh issue commands) , want record unlimited time until issue command stop recording. want video streamed , saved directly time capsule if possible. so easy way of explaining want i plug in raspberry pi , connect via ssh tell raspberry pi start recording video @ 1080p @ 30fps while video being recorded getting saved directly onto time capsual have live preview mac video getting recorded can see if need adjust anything issue stop command end recording. storage space not issue me. this have work with raspberry pi model b 8gb sd card something similar ( don't know if same 1 ) http://www.amazon.co.uk/time-capsule-500gb-hard-drive/dp/b00132b0mg a network card : edimax ew-7811un 150mbps wireless nano usb adapter mac or pc this first real question , i've been searching answer please excuse me if h

php - header redirect not working at all -

i have php file called init.php want load inc.php files (that contains html). structure of file. define ("html", __dir__ . '/page/'); $page = !empty($_get['page']) ? $_get['page'] : 'index'; if (!file_exists(html . $page . '.inc.php')) $page = 'index'; header('location: ' . html . $page . '.inc.php'); for reason, redirection doesn't redirect place should redirect (localhost/page/index.inc.php) any idea of happening there? note i'm @ index.php in root directory , i've required_once init.php in same root directory. location should uri, not file path! header('location: /page/' . $page . '.inc.php'); __dir__ give directory of file being parsed (for example, /home/site/index.php . location header expecting uri (for example, /page/something.php ), not file system path.

flash - Air stagewebview scroll manipulation -

i need desktop adobe air app scroll both vertically , horizontally stagewebview (in order center content) after load completed, hide scroll vars of stagewebview , prevent scroll after initial repositioning without affecting interaction inside external document (internal scroll bars in div). right i've been able of load external url searched rest without luck. or advice and/or documentation? thank in advance guys , have nice week. the following code center scroll , hide scroll bars: var scrollbarwidth:int = 15; var maxhscroll:int = html.htmlloader.contentwidth-html.width+scrollbarwidth; var maxvscroll:int = html.htmlloader.contentheight-html.height+scrollbarwidth; html.horizontalscrollposition = (maxhscroll /2); html.verticalscrollposition = ( maxvscroll /2); html.verticalscrollpolicy = "off"; html.horizontalscrollpolicy = "off"; see

c# - Trouble with Binding Item in WP8 -

i developed take-note app, used itemsnote save list of notes, , itemmodifynote save temporary item when modify. public observablecollection<noteviewmodel> itemsnote { { return _itemsnote; } set { _itemsnote = value; notifypropertychanged("itemsnote"); } } public noteviewmodel itemmodifynote { get; set; } at mainpage.xaml ( display itemsnote binding within longlistselector), insert "edit" button next each note, when click it, set itemmodifynote's data selected item in itemsnote, navigate "modifynotepage.xaml" private void bteditnote_click(object sender, routedeventargs e) { var button = (sender button).datacontext noteviewmodel; if (button != null) { int intindex = app.viewmodel.itemsnote.indexof(button); string modifyuri = "/pages/notemodifypage.xaml?id=" + intindex.tostring(); app.viewmodel.itemmodifynote = app.viewmodel.itemsnote.el

android - Access adb shell from ubuntu terminal not working -

i trying access adb shell ubuntu terminal viewing sqlite db values. using following command: "cd /home/santhosh/android/adt-bundle-linux-x86_64-20140321/sdk/platform-tools/adb shell" but getting response : no command adb found. new linux terminal. do? tried put path also. adb shell not working. do? this wont work terminal unless use ./adb or set classpath so better use "cd /home/santhosh/android/adt-bundle-linux-x86_64-20140321/sdk/platform-tools/" then ./adb shell

howto get all segments of an android.graphics.path -

i have andoid.graphics.path created moveto(),lineto(),cubeto() , close(). how these operations ? mean following pseodcode: operations[] = getoperations(mypath); string soperation=operation[0].type; // moveto,cubeto,lineto,close int x=operation[0].x; int y=operation[0].y; i'm afraid isn't possible. in source of android.graphics.path , you'll observe method directly invokes native method, , doesn't provide mechanism of retrieving segments. if wish keep tuples, i'd suggest maintaining own array.

c# - I Can not disable button due to error Cannot implicitly convert type string to bool -

i need disable search button after information displayed in grid view. when wrote "btnsearch.enabled="false";" in grid view button, cannot implicitly convert type 'string' 'bool' message raise may give me solution please ? protected void gvemployeeleaves_selectedindexchanged(object sender, eventargs e) { btnsearch.enabled="false"; } problem : "false" not valid boolean value(it string) so should change either string "false" false or convert string "false" boolean. you can directly assign false enabled property without double quotes below: btnsearch.enabled = false; or you can convert string false boolean value using convert.toboolean() method , assign try this: btnsearch.enabled=convert.toboolean("false");

jsf - Wrong values in <p:rowExpansion> and empty values in <p:cellEditor> on scolled page when using <p:dataTable lazy="true" liveScroll="true"> -

i using jsf 2.2 primefaces 4.0. have <p:datatable> live scrolling , lazy loading , row-expansion , cell-editing , etc. <p:datatable id="dtatable" selection="#{cont.selectedarray}" resizablecolumns="true" draggablecolumns="true" var="datamodel" value="#{cont.yieldbondsmodel}" editable="true" editmode="cell" selectionmode="multiple" rowselectmode="add" scrollable="true" scrollheight="650" rowkey="#{modeld.id}+#{model.name}" rowindexvar="rowindex" filterevent="enter" styleclass="screenscrollstyle" scrollrows="25" livescroll="true" lazy="true" rows="50" filteredvalue="#{cont.filteredmodel}" widgetvar="dt4" > <p:rowexpansion> <h:panelgrid id="

java - kryo serializing of class (task object) in apache spark returns null while de-serialization -

i using java spark api write test application . using class doesn't extends serializable interface . make application work using kryo serializer serialize class . problem observed while debugging during de-serialization returned class object becomes null , in turn throws null pointer exception . seems closure problem things going wrong not sure.since new kind of serialization don't know start digging. here code testing : package org.apache.spark.examples; import java.io.filewriter; import java.io.ioexception; import java.io.printwriter; import java.net.inetaddress; import java.net.unknownhostexception; import org.apache.spark.sparkconf; import org.apache.spark.api.java.javardd; import org.apache.spark.api.java.javasparkcontext; import org.apache.spark.api.java.function.function; /** * spark application test serialization issue in spark */ public class test { static printwriter outputfilewriter; static filewriter file; static javasparkcontext ssc;

objective c - Button on Custom info Window not Receiving Action in ios -

i using google maps in ios application , have implemented custom info window showing title of marker. now, added button on custom info window problem button action method not called. custominfowindow.h #import <uikit/uikit.h> @interface custominfowindow : uiview @property (nonatomic,weak) iboutlet uilabel *addresslabel; @property(nonatomic) iboutlet uibutton *button; @end and in infowindow.xib , have added uilabel called addresslabel uibutton called button viewcontroller.h #import "custominfowindow.h" @interface viewcontroller : uiviewcontroller<gmsmapviewdelegate> { gmsmapview *mapview; } @end viewcontroller.m - (uiview *)mapview:(gmsmapview *)mapview markerinfowindow:(gmsmarker *)marker { nslog(@"mrker tapped"); custominfowindow *infowindow = [[[nsbundle mainbundle]loadnibnamed:@"infowindow" owner:self

c# - How to fetch Dataset if there is null value in some column of the table -

some of fields null , want view remaining details in other columns. calling store procedure , getting dataset. sp returning dataset id's have column fields full. otherwise it's not returning thing. there anyway can fetch details in spite of having null values.

streamwriter - Unable to write to text file in VB.NET -

i have tried 10+ different streamwriter examples found on web (including msdn.microsoft.com) write file vb.net program, text file never created , existing text file created never appended to. i gave full permissions write file created including directory. don't know i'm missing. program runs , not give errors. not see error in event viewer. there else can prevent program adding file? below 1 example i've tried using: system.io.file.appendalltext("c:\log\mylog.txt", "-------test 1-------" & vbcrlf)

python - Web spider not returning all results -

if here not 2 different spiders automatically add results mysql database. i've added if , elif statement , work miss out results, there 52 rows in bath table, there 41. bristol used have 154 141. cannot think why results not same. pipelines.py import sys import mysqldb import mysqldb.cursors import hashlib scrapy.exceptions import dropitem scrapy.http import request class testpipeline(object): def __init__(self): self.conn = mysqldb.connect( user='user', passwd='pwd', db='db', host='host', charset='utf8', use_unicode=true ) self.cursor = self.conn.cursor() def process_item(self, item, spider): try: if 'bristolqualification' in item: self.cursor.execute("""insert bristol(bristolcountry, bristolqualification) values ('{0}', '{1}')""".format(item['bristolcountry'], "".join([s

c# - How to deal with control events firing when attempting to clear a form -

i'm looking efficient way clear winform after data has been submitted. use static method accepts control parameter , loops through control(s), determines type of control , clears contents of control. works quite problem i'm having control events. when clear control, control event fires , since there data type conversion present in event (int.parse example) causes error because once control cleared, control event fired , empty string passed int.parse. aside using bunch of if statements or int.tryparse in event control prevent data conversion happening, there better way clear control , not trigger it's event in process? thanks here example of control event , clear method: private void quantity_textchanged(object sender, eventargs e) { presenter.quantity = int.parse(quantity.text); } public static void clearform(control.controlcollection controls) { foreach (control ctrl in controls) { if (ctrl.gettype() == typeo

asp.net mvc 4 - MVC4 - Controller Scaffolding, Custom Data context class issue: Unable to retrieve metadata -

when try create controller scaffolding, following error: unable retrieve metadata 'turkup.models.admin.createcourseviewmodel'. schema specified not valid. errors: mapping of clr type edm ambiguous because multiple clr types match edm type 'coursework'. here code model: using system.componentmodel.dataannotations; using system.web.mvc; namespace torkup.models.admin { public class createcourseviewmodel { [hiddeninput(displayvalue = false)] public int id { get; set; } [required] public string title { get; set; } } } the custom data context class: using system.data.entity; using system.linq; using torkup.classlibrary; using torkup.classlibrary.admin; using torkup.classlibrary.user; namespace torkup.infrastructure { public class universitydb : dbcontext, iuniversitydatasource { public universitydb() : base("defaultconnection") { } // admin data public dbset<course> c

C# XML to Linq element name not working -

i trying consume rest web service using c# getting error when trying values of individual data points in xml string. the xml looks this: <queryresult xmlns="http://www.example.com" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <records xsi:type="sobject"> <type>account</type> <id>0013000000lkoumaa5</id> <name>example inc.</name> <billingcountry>us</billingcountry> <website>http://www.example.com</website> <createdbyid>00530000000i1jaaaq</createdbyid> <createddate>2008-02-04t14:51:23.000z</createddate> <lastmodifieddate>2014-04-02t18:10:32.000z</lastmodifieddate> <lastmodifiedbyid>00580000005ptwaaau</lastmodifiedbyid> </records> </queryresult> using following code able parse xml string not return value "name" element, re

Suggestions for data modelling in Neo4j -

i'm trying figure out how model scenario in neo4j. i have "product" node name attribute. problem name attribute can several variations across different languages should reference same node. i want able search across name , of variations reference 1 node. .eg. name: banana variation: banano variation: banane etc. nodes: food {id: 1, name: "banana"} translation {id: 1000, name: "banane", language: "french"} relationship (:food)<-[:similar_to]-(:translation) i'm looking more efficient work index fast search. any suggestions on how best model scenario ? here example of can do: (:product {id: 1})-[:has_name]->(:name {name:"banana", lang:"en"}) " -[:has_name]->(:name {name:"banane", lang:"fr"}) " -[:has_name]->(:name {name:"banano", lang:"it"}) (:product {id: 1})-[:similar_to]->(:food) you

spring mvc - Thymeleaf: how to include page specific javascript using layouts? -

using thymeleaf there way decorate layout w/ page specific javascript , javascript includes? <!--my layout --> <!doctype html> <html> <head> </head> <body> <div th:replace="fragments/header :: header"> </div> <div class="container"> <div layout:fragment="content"> </div> </div> </body> </html> <!--my page --> <!doctype html> <html layout:decorator="layout"> <head> </head> <body> <div layout:fragment="content"> hello world </div> <script src="pagespecific1.js"></script> <script src="pagespecific2.js"></script> <script> alert("hello world") </script> </body> </html> in layout template, put fragment script. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thym

opencv - save an image in a complete path -

i using opencv library , visual studio 2013. save result image in complete path. it's ok same path c:\\... doesn't work. tried use both forward \ , / , result looked same. here code: #include<iostream> #include<opencv2/imgproc/imgproc.hpp> #include<opencv2/highgui/highgui.hpp> using namespace std; using namespace cv; int main() { mat src, dst; float sum; /// load image src = imread("lena.jpg", cv_load_image_grayscale); if (!src.data) { return -1; } // define kernel float kernel[3][3] = { { 1 / 9.0, 1 / 9.0, 1 / 9.0 }, { 1 / 9.0, 1 / 9.0, 1 / 9.0 }, { 1 / 9.0, 1 / 9.0, 1 / 9.0 } }; dst = src.clone(); (int y = 0; y < src.rows; y++) (int x = 0; x < src.cols; x++) dst.at<uchar>(y, x) = 0.0; //convolution operation (int y = 1; y < src.rows - 1; y++){ (int x = 1; x < src.cols - 1; x++){ sum = 0.0; (int k = -1; k <= 1; k++){ (int j = -1; j <= 1; j++){ s

sql - Display data from database to textbox -

i trying show data database textbox , write in textbox. last code got. here data showing in datagrid. instead of datagrid how data textboxes. public sub selectitem(byval itemcode string) try sql.opendbconnection() dim strsql string = "select itemcode 'item code',itemname 'item name' " & _ " tblitemmaster itemcode= @itemcode" dim cmd new sqlcommand(strsql, sql.sqlconn) dim ds new dataset cmd.parameters.addwithvalue("itemcode", itemcode) dim da new sqldataadapter(cmd) da.fill(ds, "tblitemmaster") dgvpurchaseorder.datasource = ds.tables("tblitemmaster") sql.sqlconn.close() catch ex sqlexception msgbox(ex.message, msgboxstyle.critical, "sql error") catch ex exception msgbox(ex.message, msgboxstyle.critical, "general error") end try end sub i have no idea how that. please me if

vb.net - Convert Pdf to Bitmap via code -

i know there's tons of threads "out there" can find bitmap pdf , how add images pdf. i have pdf convert jpeg. i've tried use itextsharp can find info making pdf, not other way araound. ideas or links actual code? imagemagick uses ghostscript handle pdfs if task i'd recommend using ghostscript. there's managed wrapper here , can ghostscript binaries here . come in installer can extract them using 7-zip. see this discussion on need deploy in app. might have play around 32-bit vs 64-bit. also, on ghostscript download page please read "which license right me?" section.

java - JSF- <h:commandButton> does not invoke new window from backing bean -

my issue similar issue having in xhtml , calls backing bean method invoking new window pre constructed url.but problem not opening url. my code in xhtml given below <h:commandbutton style="margin-left:1em;width: auto; height: 20px;font-size:85%" value="webphone" id="lwebpne"rendered="#{bean.editcmdactionflg == true , (bean.selectedsearchsysdetrow.isfeed != '1' or bean.selectedoverviewdetails.webpheflg == false)}"actionlistener="#{bean.webphonesearch}" > <f:param name="lpid" value="lpid" /> </h:commandbutton> , code given in backing bean public void webphonesearch(actionevent event) { logger.info("webphonesearch method enter .."); string param = ""; map<string, string> params = facescontext.getcurrentinstance() .getexternalcontext().getrequestparametermap(); if (params.get("lpid") != nu

windows - cURL POST multiple files with different names (emulate wildcard) -

this little on head, please specific in responses. i have performed https form post using curl. here code, simplified: curl.exe -e cert.pem -k -f file=@"c:\dir\test.txt" "https://www.example.com/ul_file_curl.ashx" here's problem: need make code upload 2 files each day, , names change every day based on several variables, date , time of creation. what want replace test.txt *.txt , curl doesn't seem support wildcards, how can accomplish this? in advance. edit: done in windows environment.

Service not injecting properly into quartz job class With quartz scheduler plugin (v1.0.1) for grails 2.3.6 -

i've implemented own quartz job classes take in service method . however, service doesn't seem injecting job class nullpointer exception when accessing service. how services injected during trigger of job . any suggestion on how invoke method in service job class update 1 : added job code , log messages import org.quartz.job; import org.quartz.jobexecutioncontext; import org.quartz.jobexecutionexception; import org.quartz.jobdatamap; import com.unitrac.app.reportcentre.report.reportservice; // logging import org.apache.commons.logging.logfactory; class reportjob implements job { def reportservice; def grailsapplication; // logging private static final log = logfactory.getlog(this); void execute(jobexecutioncontext context) throws jobexecutionexception { // execute job jobdatamap jobmapdata = context.getmergedjobdatamap(); try { log.debug("in report job - executin

c# - Picking data inside a string via reflex -

Image
okay have been trying pick data string reflex(in c#) while, want pick between customer , <\div> dont seem able data: code: string text= "<div> company = fake company </div><div>customer: xxxx</div><div>device: ny-fil05 </div><div>service: device fail:</div> " var groups= regex.match(text, @"customer: (.*\b</\div>\b")).groups; var auxi = groups[1].value; basically need grab xxxx im either grabbing or grabbing nothing string text = "<div> company = fake company </div><div>customer: xxxx</div><div>device: ny-fil05 </div><div>service: device fail:</div>"; match m = regex.match(text, @"(?<=customer: ).*?(?=</div>)"); if (m.success) console.writeline(m.value); explanation: (?<=customer: ).*?(?=</div>) debuggex demo

What is a "RS" in a html(text) file? -

Image
the file opened everedit. want know "rs" is. and notepad++ i got page our school library website. page shows result of query book. books may written more 1 author. authors column there contains 2 authors little space between them. page works fine ie6. on ie11, firefox , chrome space vanished. 2 authors became 1 author long name. opened html file using notepad.exe , found nothing. opened everedit, got "rs" there. it sounds it's non-printable character, can appear differently in different applications. (i ran problem these in sql queries once, colleague using different editor copied/pasted things differently.) it's tough certainty character is, based on this table (or this one separates out non-printable characters) best guess record separator: dec 30 hex 1e oct 036 char rs if can examine character in octal or hexadecimal editor can confirm this. you'd have identify byte examine (probably copying small piece file examin

openldap - Export/import LDAP data using perl script -

i new in openldap , perl. want export /import ldap data with/without schema ldap database. possible using perl script? if yes ,please give me sample code. create new schema using openldap , perl without dns.how that? this many questions in 1 item. please ask 1 question @ time. how read ldap wtih perl: use strict; use warnings; use data::dumper; ### ldap use convert::asn1; use net::ldap; use net::ldap::util qw(ldap_error_name canonical_dn ldap_explode_dn ldap_error_text); use net::ldap::ldif; %parms ( host => 'localhost', port => 389, binddn => 'your dn', passwd => 'password', base => "", filter => "(objectclass=*)", scope => "base", attrs => ['*'], ); $ldif = net::ldap::ldif->new( "out.ldif", "w", onerror => 'die', wrap => 0 ); $ldap= net::ldap->new($parms{'host'}, port => $parms{'port'}); $bind_result

c# - Where to store user input data in WPF application? -

i have wpf application contains few pages user enter data. need store data until user finishes input , need data , print out verification. i know there dictionary able store keys , data, how store data starting page until final page? create class file store data or there other better solution solve problem? it big question more domain model wpf. sounds have collecton of data. collection must ... think have name. e.g. "results", "survey", or "bill of materials". model , model data. now talking wpf stuff, each data entry page "bind" individual "data" model. whatever user using navigate through data bind collection thing. keywords want lookup: binding datacontext observablecollection mvvm start small. have long rich path.

asp.net mvc 4 - HttpContext.Current null when making a function Asynchronous in MVC4 -

i working on mvc4 in vs2010-sp1. made 1 of function in controller class asynchronous. part of made controller class derived asynccontroller , added below 2 methods ( see code section 1 , 2 below). 1 method ending async(see code section 1 ) , method ending completed ( see code section 2 ). problem in model class trying access webservice credentials httpcontext ( see code below 3 ). context going null when making asynchronous call. ie, in new thread httpcontext not available. how pass context main thread new threads created. code section 1 public void sendplotdatanewasync(string fromdate, string todate, string item) { asyncmanager.outstandingoperations.increment(); var highchartmodel = new highchartviewmodel(); task.factory.startnew(() => { asyncmanager.parameters["dataplot"] = highchartmodel.getgraphplotpointsnew(fromdate, todate, item);

c# - How to select the listbox items from View Model -

i want select list box items view model? my xaml is:- <grid x:name="mvvmlistboxuicontainer" grid.row="1" margin="2,0,2,0"> <listbox height="374" itemssource="{binding studentdetails,mode=twoway}" horizontalalignment="left" margin="2,6,0,0" name="listbox1" verticalalignment="top" width="476" borderbrush="#00410d0d"> <i:interaction.triggers> <i:eventtrigger eventname="tap"> <i:invokecommandaction command="{binding eventpagecommand, mode=oneway}"/> </i:eventtrigger> </i:interaction.triggers> <listbox.itemtemplate> <datatemplate> <border borderbrush="gray" padding="5" borderthickness="1"> <stackpanel orientation="horizontal"> <border borderbrush="w

Sorting php array in Redis -

i have array of objects (result of mysql query) array(28) { [0]=> array(2) { ["member_id"]=> string(5) "40105" ["last_login"]=> string(19) "2014-02-18 06:04:06" } [1]=> array(2) { ["member_id"]=> string(5) "51758" ["last_login"]=> string(19) "2014-04-21 09:29:11" } [2]=> array(2) { ["member_id"]=> string(5) "52682" ["last_login"]=> string(19) "2014-04-21 08:27:00" } what best datatype sort in redis ? need search , add object result? shall use set or list ?

locking - SQL Server Delete Lock issue -

i have sql server database deleting rows 3 tables a,b,c in batches conditions through sql script scheduled in sql job. job runs 2 hours tables have large amount of data. while job running, front end application not accessible (giving timeout error) since application inserts , updates data in these same tables a,b,c . is possible front end application run in parallel without issues while sql script running? have checked locks on table , sql server acquiring page locks. can read committed snapshot or snapshot isolation levels or converting page locks row locks here. need advice. split operation in 2 phases. in first phase, collect primary keys of rows delete: create table #templist (id int); insert #templist select id yourtable in second phase, use loop delete rows in small batches: while 1=1 begin delete top (1000) yourtable id in (select id #templist) if @@rowcount = 0 break end the smaller batches allow front end a

html - save input type file state after server validation mvc -

i have html form textbox controls , <input type=file> control uploading file. controls have server validation. imagine next situation: select file uploading , enter data textbox controls(some textboxes leave blank). click submit button , form sended server action. after validation checking in server redirect same form error correction. textboxes save state , have data file control don't have. p.s. when debugging code, see uploaded file in view model. can resend html form? don't write code because think redundant. you can filename (eg. myfile.txt ), not full path (eg. /home/martin/myfile.txt or c:/users/martin/myfile.txt ), can't set value server-side or javascript. reasons of security & privacy. what can instead: validate form javascript or ajax request, if fails, original form (& values) unchanged (i recommend this). save file contents on first try, , if retry fails , user didn't give new file, use saved file contents (this may requ

Update text file with the name and also run an exe using batch file -

i below things every single file the files ext .mtc inside particular directory in loop using batch script. can please help? output name of file in text file in variable run application exe pass file name variable text file (in step 1) batch file can used output same 2nd batch file *basically want retain name of file stored in 1st batch file 2nd batch file i able step 2 of running application each of mtc file not able step 1 , step 3. something : @echo off /f "delims=" %%a in ('dir /b/a-d *.mtc') call:execute "%%a" exit /b :execute echo treating : %1 yourexe.exe call your_second_bat.bat %1 and second batch value of .mtc file in %1 your_second_bat.bat : @echo off echo value received first bat [%~1]

Eclipse - Searching for strings in JRE System Libraries or Referenced Libraries does not work -

i can search files, folders or whole workspace search function, whenever select either 'jre system library' or 'referenced libraries' eclipse returns "'*' - 0 matches in empty scope". checked 'consider derived resources' no avail. i aware these files read-only, why cannot search through them?

javascript - Require.js continues to load uncompressed modules after optimization -

Image
i've run r.js optimizer , seems working properly. trouble i'm having while compressed optimized version loads continues load uncompressed modules. reason why happen? build.js { appdir: '../static', mainconfigfile: '../static/javascript/config.js', dir: '../public', baseurl: 'javascript/libs', usestrict: false, wrap: false, optimizecss: "standard", optimize: "uglify2", generatesourcemaps: false, preservelicensecomments: false, uglify2: { "screw-ie8": true, warnings: false, mangle: true }, throwwhen: { optimize: true }, pragmasonsave: {}, modules: [ { name: '../front', include: ['views/front/main'], exclude: ['../config'] } , { name: '../portal', include: ['views/portal/main'], exclude: ['../config'] } , { name: '../survey', include: ['vi

How to convert Base64 encoded pkcs12 content to java.security.PrivateKey? -

i'm consuming google directory api via service account , received pkcs12 key @ service account creation. google support 2 different ways use taking key java.io.file or java.security.privatekey , poc, have used first way creating googlecredential object using java.io.file , googlecredential credential = new googlecredential.builder() .settransport(httptransport) .setjsonfactory(jsonfactory) .setserviceaccountid(serviceaccountid) .setserviceaccountscopes(arrays.aslist(directoryscopes.admin_directory_user)) .setserviceaccountuser(serviceaccountuser) .setserviceaccountprivatekeyfromp12file(serviceaccountprivatekeyfile) .build(); it's working expected in actual use case cannot rely on filesystem cannot use first method. wanted implement actual use case using second way using java.security.privatekey , following when done. googlecredential cred

html - Responsive design css dom element manipulation -

i have div field including input element , label element. both display: block <div class="cf-full"> <input id="a" > <label class="helptext"</label> </div> so in normal view, input field come first. however, want layout responsive, in mobile label come first. i know dom manipulation can achieved javascript easily. there way achieve reverse dom elements order pure css? this works div { display:table; } input { display:table-footer-group; } label { display:table-header-group; } http://jsfiddle.net/v8xtc/

Store different collection in different files in MongoDB -

i'm going migrate sql server database mongodb. have multiple tables lot of data. know if possible break single mongo db file multiple files 1 each collection in mongo. there no single mongodb data file. mongodb allocate initial file database , add files needed. on mac configured starts 64mb file, next double size (128mb) , doubles next 1 etc till get's 2gb , files after 2gb in size. you can modify various configuration options http://docs.mongodb.org/manual/reference/configuration-options/ keep in mind storage file allocation per database, not collection.

image - Jquery active link change src -

i have paralax effect on site , want make active dot. problem every dot must diffrent on active green orange mint blue and when they`re not active want them white. and important me change src of image not .css here code 1 color active dot: <ul class="paralax"> <li><a href="#intro" title="next section"><img src="https://dl.dropboxusercontent.com/u/64675374/circle2/dot.png" /></a></li> <li><a href="#second" title="next section"><img src="https://dl.dropboxusercontent.com/u/64675374/circle2/dot.png" alt="link" /></a></li> <li><a href="#third" title="next section"><img src="https://dl.dropboxusercontent.com/u/64675374/circle2/dot.png" alt="link" /></a></li> <li><a href="#fif

java - No Main Function -

ok, trying run , tells me there no main (i have tried putting 1 in , termination , syntax error) wrong and/or put main function? here code import javax.swing.*; import java.awt.*; import java.awt.event.*; public class stylelistener extends jpanel { private static final long serialversionuid = 1l; private jcheckbox bold, italic; private jlabel saying; private jsplitpane splitpane; public stylelistener() { splitpane = new jsplitpane(jsplitpane.vertical_split); splitpane.setonetouchexpandable(true); splitpane.setpreferredsize(new dimension(300,200)); splitpane.setbackground(color.green); splitpane.setdividerlocation(100); jpanel subpanel1 = new jpanel(); subpanel1.setpreferredsize(new dimension(300, 100)); subpanel1.setbackground(color.cyan); saying = new jlabel ("say style!"); saying.setfont (new font ("helvetica", font.plain, 36)); subpanel1.add (saying); splitpane.settopcomponent(subpanel1); jpanel subpanel2 =

algorithm - How to do high dimensional range query with fixed range? -

i have 10^4 points in 7 dimensional space. application, need make ~10^6 range queries on input find points lie inside given range. in application, queries use same range size. appropriate data structure problem? kd-tree seems apt, 7 dimensions , small output size linear in time complexity queries. solution range trees, seems complex construct small number of input in application. also, don't see of these structures using fact range constant size advantage. example, if 1d problem, queries asking points lying inside range of size 10 example, @ different places along number line. well, late answer, dont know if s usefull now. can use fixed height fqts (fhfqt or fhqt) [ http://users.dcc.uchile.cl/~rbaeza/ftp/fqtrees.ps.gz] or fixed query arrays (fqa) [ http://www.dcc.uchile.cl/~gnavarro/ps/mtap01.pdf] . these structures work in kind of similarity searching. beside that, need use pivot selection method incremental 1 results. assume using euclidian distance , distances h

Display dialog box before intent activity starts in android -

i'm creating application in i've display dialog box. dialog box having edittext , button. want display dialog box before activity starts. please me. create instance of dialog in oncreate(); , show in onresume();

What is the minimum target CPU architecture for the various versions of Visual Studio? -

what minimum target processor architecture (indicated _m_ix86 predefined macros) supported every version of visual studio 2008, 2010 , 2012? for example, msvs 2012 supports pentium pro , higher. the classic switch /g . available options differed different versions of compiler (with newer versions dropping older options, albeit continuing accept them compatibility reasons). here's got: /g3 built code optimized 386 processors ( _m_ix86 set 300) /g4 486 processor ( _m_ix86 set 400) /g5 built code optimized pentium ( _m_ix86 set 500) /g6 built code optimized pentium pro, ii, , iii ( _m_ix86 set 600) /g7 built code optimized pentium 4 or amd athlon ( _m_ix86 set 700) /gb specified either "blend" mode or lowest common denominator reasonable when version of compiler released. default option if no other specified. and of course, bears explicit mention setting option optimize newer processor architecture did not prevent code running on older