Posts

Showing posts from April, 2015

jquery.min.js & jquery-ui.min.js Vs jquery.* * .js file? -

jquery.min.js & jquery-ui.min.js Vs jquery.* * .js file? - i not conversant jquery , want know basic things jquery's js files. what basic difference in jquery min js & jquery js file e.g. drag, drop, mouse, model etc.. suppose working jquery dialog model, downloaded jquery js files saved in web application , include js file given below if need utilize drag & drop 1 time again need include respective jquery js file <script src="ui/jquery.ui.widget.js"></script> <script src="ui/jquery.ui.mouse.js"></script> <script src="ui/jquery.ui.core.js"></script> ......... ....... ....... <script src="ui/jquery.ui.dialog.js"></script> now find way manage 2 files , not need include separate js file other functionality e.g. drag, drop. downloaded 2 js files 1. jquery.min.1.*.js , 2. jquery-ui.min.1.*.js <script src="ui/jquery.min.1....

java - How to set up the path in newBufferWriter -

java - How to set up the path in newBufferWriter - how can set path right newbufferwriter . i'm getting illustration usage of newbufferwriter oracle page: charset charset = charset.forname("us-ascii"); string s = ...; seek (bufferedwriter author = files.newbufferedwriter(file, charset)) { writer.write(s, 0, s.length()); } grab (ioexception x) { system.err.format("ioexception: %s%n", x); } i'm comfused how set file parameter, should path object, illustration want create file in directory , have set path object, , in code path object file parameter , how give string value ? or how give value of directory want create file ? and else, exception ? mean ? exception in thread "awt-eventqueue-0" java.lang.noclassdeffounderror: java/nio/file/path if getting noclassdeffounderror java.nio.file.path there wrong java environment. mixing java versions; compiling jdk 7, trying run on java 6 or older. when type java -v...

php - Show part of a IP address -

php - Show part of a IP address - 85.124.99.2 how can hide lastly 2 numbers ip? and create like: 86.124.xxx.xxx wrote quickly $ip = "85.124.99.2"; $parts = explode('.',$ip); $new_ip = $parts[0].'.'.$parts[1].'.xxx.xxx'; warning: should test length of parts before accessing $parts[n] php string ip-address

actionscript 3 - Flex and polygonal.de graph classes in pathfinding? -

actionscript 3 - Flex and polygonal.de graph classes in pathfinding? - i wondering if have done already, send me right direction.. the issue follow : have 2 dimensional array, on hold integer numbers, if number 0 - item shall not included graph, if 1 - must included. result graph shall used patfinding ( shortest path ) element. how turn 2 dimensional array graph ? ( polygona.de classes if possible ), i trying polygonal.de classes. suggestions , points right direction more appreciated. this 2 dimensional structure. reddish cells prohibited walk on, , there must found optimal path "start" "end". 1st things 1st - need turn 2 dimensional construction graph :| the way see it, 2d array graph. node of graph represented pair (i, j) , may have neighbour nodes such (i + 1, j) , (i, j + 1) , etc. can write utility function array hides these low-level neighbour definitions , skips cells occupied. the de.polygonal.ds api graph info construction c...

operator keyword - Python integer * float = NotImplemented -

operator keyword - Python integer * float = NotImplemented - so messing around writing vector class when discovered interesting fact. >>> e = int(3) >>> e.__mul__(3.0) notimplemented can explain why , subsequently, how prepare vector class? class vector(tuple): '''a vector representation.''' def __init__(self, iterable): super(vector, self).__init__(iterable) def __add__(self, other): homecoming vector(map(operator.add, self, other)) def __sub__(self, other): homecoming vector(map(operator.sub, self, other)) def __mul__(self, scalar): homecoming vector(map(scalar.__mul__, self)) def __rmul__(self, scalar): homecoming vector(map(scalar.__mul__, self)) def __div__(self, scalar): homecoming vector(map(scalar.__rdiv__, self)) edit: little more clear: >>> = vector([10, 20]) >>> (10, 20) >>> b = / 2.0 >>> b (...

An efficient event loop implementation? -

An efficient event loop implementation? - possible duplicate: how implement basic event-loop? not language-specific question. efficient implementation of event loop? far i've encountered this: while (true) { handleevents(); sleep(100); } which don't think best way - if sleep duration short, eat lots of cpu, , if it's long, app pretty unresponsive. so, there improve way? thanks the mutual pattern is: while (waitfornextevent()) { handleevent(); } with waitfornextevent() returning false indicate there no more events process, and, importantly, beingness able perform blocking wait next event. for instance, event source might file, socket, thread's message queue or waitable object of kind. in case, can guarantee handleevent() runs if event ready, , triggered shortly after event becomes ready. events event-loop

tsql - I got stuck on cycles to get the path of a sql directed graph -

tsql - I got stuck on cycles to get the path of a sql directed graph - i've got table maintain couples of numbers, indicate arcs of directed graph, every node identified integer value: create table graph ( n2 integer not null, n1 integer not null, primary key (id_area_possesso, id_area_utente) constraint ck check (n1 <> n2) ) where n1 points n2, , on; so, instance, when insert insert graph values (3,4) insert graph values (9,3) insert graph values (12,9) i obtain graph: 4->3->9->12. i utilize query list of arcs (the path) starting node: with tmp (n2,n1) ( select g.n2 , g.n1 graph g n1=3 union select n2 , n1 graph g bring together tmp on (g.n1=tmp.n2) ) select * tmp go as result of query obtain arcs: (9,3) (12,9) this query works fine, when there cycles on graph: insert graph values (0,1) insert graph values (2,0) insert graph values (1,2) it goes on infinite loop, , error message: the statement terminated. m...

PHP MYSQL - Echo mysql value containing a PHP variable? -

PHP MYSQL - Echo mysql value containing a PHP variable? - i trying variable display, when used part of value within of mysql table. $variable = 'cool'; mysql field value "this '.$variable.' wow" when echo value, displays as: this '.$variable.' wow i want display as: this cool wow what trick here? @mark sorry im new this $linkquery3 = 'select model models model_id = "'.$pagemodel.'" '; $sql15 = mysql_query($linkquery3) or die(mysql_error()); if (mysql_num_rows($sql15) == 0) { die('no results.'); } else { while($row = mysql_fetch_assoc($sql15)) { $model = stripslashes($row['model']); } } $linkquery2 = 'select l.link , l.desc , l.domid , d.domain links l inner bring together domains d on d.domid = l.domid l.catid="'.$pagecat.'" && (l.modid="1" || l.modid="'.$pagemodel.'") order domain '; $sql3 = mysql_qu...

user interface - C# - Calculator, what else to account for and incorporate? -

user interface - C# - Calculator, what else to account for and incorporate? - so building calculator in c# fun seek utilize language , gui side of things.. i wondering if has suggestions on how go or functionality should incorporate improve knowledge of c# , can do. right have simple calculator next (in decimal , binary): adds subtracts multiplies divides checks gcd checks if prime any other suggestions should do? love have many ideas possible, create calculator advanced possible. does know how go doing 'graphing' calculator function can graph functions? you run downwards built-in math class function list here if serious adding lot of functionality. sines, cosines, tangents, etc... http://msdn.microsoft.com/en-us/library/system.math.aspx c# user-interface graph calculator functionality

generics - Initializing variable. I don't know their type [java] -

generics - Initializing variable. I don't know their type [java] - class pair<u,v>{ u first; v second; public pair() { first = new u(); //error sec = new v(); //error } public pair(u f,v s){ first = f; sec = s; } } required: class found: type parameter is possible initialize first / second (without-arguments) constructor of u/v type other way? java not allow because of type erasure. can specify constructor arguments of type class<u> , class<v> , pass in concrete class types of given type parameters (i.e., integer.class , string.class <integer> , <string> ). it possible extract type using bytecode-level reflection, quite complicated, , doesn't work in situations. if scroll downwards on this article, can find illustration makes possible. i've pasted below convenience. static public type gettype(final class<?> klass, final int pos) { // obtain anonymous, if any, class 'this' inst...

objective c - putting a string in a char to an sql statement? -

objective c - putting a string in a char to an sql statement? - i using xcode ,and have question in objective c ,maby can help me . my function gets string, takes , set sql statement , , not sure how because statement char, , found many ways convert it. i : sql_for_event= " select basic_pic,spritesheet,sound database when event= %c",[awaking_event utf8string] ; when sql_for_event statement, , awaking_event nsstring function. how can ? thanks lot . the %c specifier prints single char , need part of sprintf phone call scenario. easier way be sql_for_event= [[nsstring stringwithformat:@"select basic_pic,spritesheet,sound database event= '%@'",awaking_event] utf8string]; objective-c xcode

associations - CakePHP not loading associated properties with model on production server -

associations - CakePHP not loading associated properties with model on production server - this weird one. i have local server on develop apps. product review app developed works flawlessly on it, , utilizes cake's associative modeling ($hasmany, $belongsto, et. al.). after pushing app production server, fails. gives me error message: notice (8): undefined property: appmodel::$product [app/controllers/reviews_controller.php, line 46] reviewscontroller::home() - app/controllers/reviews_controller.php, line 46 dispatcher::_invoke() - core/cake/dispatcher.php, line 204 dispatcher::dispatch() - core/cake/dispatcher.php, line 171 [main] - app/webroot/index.php, line 83 i've debug() 'd $this , shows, plain day, that, while local server loading associated models, production server not. databases mirror duplicates (literally, production server imported dev db), , can manually load models, tells me it's connecting db fine. what on earth going on? update t...

asp.net mvc 3 - Passing values to Controller via Javascript return View MVC3 Razor -

asp.net mvc 3 - Passing values to Controller via Javascript return View MVC3 Razor - i brand new mvc. trying pass longitude , latitude values obtain using geolocation controller can utilize values identify , pull right info database. here javascript function auto_locate() { alert("called station"); navigator.geolocation.getcurrentposition(show_map); function show_map(position) { var latitude = position.coords.latitude; var longitude = position.coords.longitude; var locstring = latitude.tostring() + "." + longitude.tostring(); var postdata = { latitude: latitude, longtitude: longitude } alert(locstring.tostring()); } } all of works fine; now need pass postdata or locstring controller. looks this: [httpget] public actionresult autolocate(string longitude, string latitude) { new mynamespace.areas.mobile.models.geo { latitude = convert.todouble(latitude), longitude = convert.todouble(lo...

mysql - The concept of implementing key/value stores with relational database languages -

mysql - The concept of implementing key/value stores with relational database languages - i want myself wet concept of implementing key/value stores relational database languages (like mysql , sql server). however 1 of times when google isn't enough. does know of info / links regarding concept of implementing key/value stores relational database languages? try this link, may give ideas, , there this similar question key value pairs in relational database mysql sql-server database nosql

cuda - Number of active warps in GPU (Fermi) -

cuda - Number of active warps in GPU (Fermi) - i have quick question active warps in gpu (i prefer know in fermi). specific kernel, number of active warps @ cycle in sm same whole execution time of kernel? experimented, there correlation between total number of active warps (for whole execution) , number of synchronizations in programme kernel. can clarify relation? thanks the number of active warps can vary on time since: other threadblocks can finish or begin on same sm, if have 4 warps per threadblock if 1 threadblock resident on sm have 4 warps, 2 or 3 threadblocks have 8 or twelve resp. if warp reaches end of code no longer executing code (naturally) the active warps count whole programme execution depend on number of factors, remember incremented number of active warps on each cycle. means if increment number of syncs, increment number of cycles each warp requires execute kernel, expect higher active warps count. also note derived statistics in profiler a...

java - Input values to textfields, stream back to website -

java - Input values to textfields, stream back to website - i connected website, used jsoup find "textfield" id's, input values, need stream out. can please help me right coding stream "modified" doc website? if (source == enter2) { string url = "http://www.clubvip.co.za/login.aspx"; element number; element pass; element keyword; seek { document doc = jsoup.connect(url).get(); number = doc.getelementbyid("ctl00_contentplaceholder1_cellnumberradtext").attr("value", "number"); system.out.println(number); pass = doc.getelementbyid("ctl00_contentplaceholder1_passwordradtext").attr("value", "password"); system.out.println(pass); keyword = doc.getelementbyid("ctl00_contentplaceholder1_keywordradtext").attr("value...

Entity Framework 4: Drastic performance problems with global BaseClass -

Entity Framework 4: Drastic performance problems with global BaseClass - as proof of concept i've changed model every entity derives abstract base of operations class "trackableentity". seemed work fine in beginning. while testing, i've encountered severe performance problem when lazy-loading simple navigation-property of entity. first time association called in context takes 10 seconds load related entity (from table 5 entries!!). test system, there total of 100 entries in whole database. any ideas? thanx. you're running under debugger, right? if so, manually pause , display stack. grab in act, , problem on stack. might want repeat few times, create sure. here's why works. performance entity-framework

javascript - Ajax - Checking for connection drops -

javascript - Ajax - Checking for connection drops - i writing web chat application. uses long polling mechanism. send request server, , server holds until there info send back. responds, , client sends request server. , cycle repeats. however, there problem - have no error checking in place. if connection drops? let's i'm chatting friend , wifi drops. internet's downwards , let's goes min later. long-polling mechanism has died , no polling, have refresh page. how can implement error checking mechanism solve problem of unsuccessful or dropped network connections? using jquery facilitate ajax requests if helps. *edit: here js code polling mechanism: * // polls server more data, regular encrypted request minte.network.poll = function() { // if client not connected, not send poll requests if (!minte.client.connected) return; minte.network.request({ "action" : "poll"}, function(data) { // if client has disc...

Can a C implementation implicitly include standard headers when including a different header? -

Can a C implementation implicitly include standard headers when including a different header? - while reading is proper c declaration? if so, why not work? thinking about #include <stdio.h> int main(void) { int bool = 0; homecoming bool == 0; } is programme strictly conforming? in other words, stdio.h allowed include stdbool.h or forbidden so? specified spec? c standard headers can not include other headers. different c++, explicitly allowed. c99 standard, section 7.1.3 each header declares or defines identifiers listed in associated subclause[...] no other identifiers reserved. c header c99

.net - Defining a working directory for executing a program (C#) -

.net - Defining a working directory for executing a program (C#) - i trying executable launched specific folder. the code have below crashes application oddly enough: process p = new process(); p.startinfo.workingdirectory = "dump"; p.startinfo.filename = s; p.start(); i debugged it, , saying can't find file start, file / folder defintly exists, syntax bad? the code below works, working directroy not defined, can't find executable process.start(@"dump\", s); the working directory set ("dump") relative current working directory. might want check current working directory. you should able set working directory executing assemblies directory code... string exedir = path.getdirectoryname(assembly.getexecutingassembly().location); directory.setcurrentdirectory(exedir); or, improve yet, don't utilize relative path, set p.startinfo.workingdirectory absolute path. c# .net windows

ruby - Ecommerce Subscription for Rails -

ruby - Ecommerce Subscription for Rails - have seen conversations revolving around this, hoping current input perhaps best libs , services available rails developers @ moment implementing subscription membership based website. i'm interested in libs or frameworks may familiar through github or elsewhere service has given best experience far clients , own sanity? i'm leaning towards paypal , perhaps including google checkout, there lot of other options. i'd clean , appear integrated website possible while carrying trust of larger service provider such paypal , google. additionally, these micro payments @ around $1.00 usd. purchases go $15 $30. edit: since initial post i've found saas rails kit (http://railskits.com/recurring_billing/). has had experience vs recurly? doing research per first answer, appears recurly superior alternative @ point our model, rails kit may improve alternative if has met positive experiences in comparing other options. ...

audio - Android MediaRecorder to AudioTrack, Recording and Playback -

audio - Android MediaRecorder to AudioTrack, Recording and Playback - i'm trying create can record users voice , play in same activity using mediarecorder , audiotrack. don't understand how write file audiotrack. i've read documents on both , can't figure out. help appreciated. here's code far, it's not complete. buttons need read recordbutton , playbackbutton. thanks! private file outputfile = null; private audiotrack voice = null; private mediarecorder recorder = null; .... // setup recorder... recorder = new mediarecorder(); recorder.setaudiosource(mediarecorder.audiosource.mic); recorder.setoutputformat(mediarecorder.outputformat.three_gpp); recorder.setaudioencoder(mediarecorder.audioencoder.amr_nb); // setup record file... outputfile = getfilestreampath("output.amr"); recorder.setoutputfile(outputfile.getabsolutepath()); public void onclick(view v){ switch(v.getid()) { case r.id.next_butto...

.net - Programmaticaly get C# Stack Trace -

.net - Programmaticaly get C# Stack Trace - possible duplicate: how print current stack trace in .net without exception? when exception thrown, text contains stack trace. can somehow obtain stack trace text(including file , line) without exceptions? public void f() { //blah string stacktrace = ???; //blah } environment.stacktrace or system.diagnostics.stacktrace if need more convienient (i.e. not string) representation c# .net stack-trace

.net - Adding/Removing COM Ports from a ComboBox in C# -

.net - Adding/Removing COM Ports from a ComboBox in C# - i attempting write programme utilizes combobox display connected com ports obtained next method: system.io.ports.serialport.getportnames() the thought initialize thread checks available com ports every second, , update combobox accordingly. despite best efforts, can't work. the code update combobox's contents following: private void form1_load(object sender, eventargs e) { availports = new bindinglist<string>(); thread t = new thread(new threadstart(update)); t.start(); } private void update() { this.combobox1.datasource = availports; while (true) { console.writeline("check"); foreach (string port in system.io.ports.serialport.getportnames()) { if (!availports.contains(port)) { console.writeline("found"); ...

uialertview - ipad sleep wake up event -

uialertview - ipad sleep wake up event - when ipad goes sleep i.e. screen turns off, user turn on , current application @ time still open. there way observe event ipad has woken sleep? i want show uialert whenever goes sleep , wakes up. take @ - (void)applicationdidbecomeactive:(uiapplication *)application delegate method of application delegate. ipad uialertview

sql - Searching words in a database -

sql - Searching words in a database - i need improve search on website has search box searches exact same characters. if type in hyperlink homecoming starting hyperlink not such contenthyperlink, _hyperlink, etc. here sql query - select o_objectid, rtrim(o_name) o_name a_object o_name @nameprefix + '%' order o_name strictly speaking query correct, you're looking "words starting 'hyperlink'" means there space character or start of text field. select o_objectid, rtrim(o_name) o_name a_object o_name @nameprefix + '%' or o_name '% ' + @nameprefix + '%' order o_name note added space character in '% ' + @nameprefix + '%' your other alternative utilize total text search mean query this: select o_objectid, rtrim(o_name) o_name a_object ...

javascript - JQPlot pie chart throwing "Unable to get value of the property '0': object is null or undefined" error -

javascript - JQPlot pie chart throwing "Unable to get value of the property '0': object is null or undefined" error - i'm using jquery based charting library jqplot (and pie chart plugin it) generate basic pie chart. works fine in ff, etc. (surprise!) not in ie. in ie loads okay , looks fine, 1 time roll mouse on chart throws next error: unable value of property '0': object null or undefined the way i'm setting straightforward: var optionsobj = { seriescolors: ['#3399cc', '#cc6666', '#7ba550', '#ffcc66', '#d17314'], grid: { }, seriesdefaults: { renderer: $.jqplot.pierenderer, rendereroptions: { linelabels: true, linelabelslinecolor: '#777'} } }; line1 = [['coffee', 9],['beer', 4],['tv', 6],['lost umbrellas', 2],['...

listview - android change view of selected item in adapterview -

listview - android change view of selected item in adapterview - i have listview textview each item. want alter textcolor of selected item. utilize onitemselected method create changes. first select 1st row, first row's textcolor changes. when select 2nd row, text color changes, want 1st row's color alter default color. how do that, since in onitemselected refernce of selected item , not lastly selected. there way other holding reference lastly selected view. when first item selected store position in instance variable of activity, lets name currentlyselected . combine android: access kid views listview in order view @ position currentlyselected , alter it's textcolor. android listview android-adapterview itemselector

Accessing resource files in Python unit tests & main code -

Accessing resource files in Python unit tests & main code - i have python project next directory structure: project/ project/src/ project/src/somecode.py project/src/mypackage/mymodule.py project/src/resources/ project/src/resources/datafile1.txt in mymodule.py, have class (lets phone call "myclass") needs load datafile1.txt. sort of works when do: open ("../resources/datafile1.txt") assuming code creates myclass instance created run somecode.py. the gotcha have unit tests mymodule.py defined in file, , if leave relative pathname described above, unittest code blows code beingness run project/src/mypackage instead of project/src , relative filepath doesn't resolve correctly. any suggestions best practice type approach resolve problem? if move testcases project/src clutters main source folder testcases. in each directory contains python scripts, set python module knows path root of hierarchy. can define single global variable ...

jquery - Bind a javascript value in detailsview -

jquery - Bind a javascript value in detailsview - i new asp.net. trying value of jquery variable , utilize in details view. these values in jquery $("#begindate").html(data[i].begindate); $("#eventtypeid").html(data[i].event_type_id); $("#enddate").html(data[i].enddate); $("#beginlatlong").html(data[i].beginlatlong); $("#endlatlong").html(data[i].endlatlong); so, trying within detailsview: <asp:detailsview id="de" runat="server" > <fields> <asp:templatefield headertext="duplicate"> <itemtemplate> <strong>begin date:</strong> <asp:label runat="server" id="begindate" text='<%# eval("begindate") %>'></asp:label> </itemtemplate> </asp:templatefield> </fields> </asp:detailsview> but detailsview not showing on browser. can u allow me know error i've been doin...

clearcase - Config spec for applying a label -

clearcase - Config spec for applying a label - how apply label latest version of branch using config spec? can apply label using config spec. well have created branches using config spec applied labels using apply label option. want apply giving in config spec. can if how? i tried not working.thank in advance element * checkedout element /test_ari/karthik/omna.txt .../karthik_9/latest/karthik_66 element * /main/latest i want create label karthik_66 on karthik_9/latest using config spec rules how create it? according config spec rules man page, can utilize labels within config spec select version, not label one. "no". when create/manage branch, you need 3 rules, not 1 yo have: element * checkedout # 3 rules here: element /test_ari/karthik/* .../karthik_9/latest element /test_ari/karthik/* /main/latest -mkbranch karthik_9 element /main/0 .../karthik_9/latest element * /main/latest that create branch file (not omna.txt ) within ...

tfs2010 - Cannot stop Tfs 2010 Reporting Jobs -

tfs2010 - Cannot stop Tfs 2010 Reporting Jobs - i have moved our tfs 2010 server new server, when i'm trying configure reporting server , when stop reporting jobs tfs tells me there running jobs please wait untill idle. i wait long time till jobs finish no way, running. any ideas how can stop running jobs? have tried steps listed here? http://social.msdn.microsoft.com/forums/en-us/tfsreporting/thread/44a81c42-1e24-4fcd-81d4-d864aebb7479/ hth. cheers, tarun tfs tfs2010

python - Problem using Django admin Actions with intermediate pages -

python - Problem using Django admin Actions with intermediate pages - i added admin action send_email through admin.py.i want when admin uses send_email action selected users should show intermediate page selected users , inquire confirmation.in case inquire confirmation when click on "send email" button nil happens , got returned change_list view without send_email action got called. admin.py class myuseradmin(useradmin): list_display = ['username', 'email', 'first_name', 'last_name', 'is_active', staff] list_filter = ['groups', 'is_staff', 'is_superuser', 'is_active'] actions = ['send_email'] def send_email(self, request, queryset): django.core.mail import send_mail if 'apply' in request.post: in queryset: if i.email: send_mail('subject here', 'here message.', 'from@example....

VHDL: Code to put a numeric value in a STD_LOGIC_VECTOR variable -

VHDL: Code to put a numeric value in a STD_LOGIC_VECTOR variable - i come in number in a variable of type std_logic_vector have problems compiler. signal cl_output_cha : std_logic_vector (16-1 downto 0); cl_ouput_cha <= 111111111111111; the compiler give me these 2 messages: the integer value of 111111111111111 greater integer'high. type of cl_output_cha incompatible type of 111111111111111. could give me proper code line set in variable particular numeric value? give thanks much. first of all, error because number have written treated integer. i take mean number binary? in case utilize "". cl_ouput_cha <= "111111111111111"; you can go hex, x"". cl_ouput_cha <= x"ffff"; if want assign integer std_logic_vector, can this. library ieee; utilize ieee.std_logic_1164.all; utilize ieee.numeric_std.all; ... cl_ouput_cha <= std_logic_vector(to_unsigned(12345, ch1_ouput_cha'length)); --...

python - Batch converting Corel Paradox 4.0 Tables to CSV/SQL -- via PHP or other scripts -

python - Batch converting Corel Paradox 4.0 Tables to CSV/SQL -- via PHP or other scripts - recently i've begun working on exploring ways convert 16k corel paradox 4.0 database tables (my client has been using legacy platform on 20 years due massive logistical matters) more modern formats (i.e.csv, sql, etc.) en mass , far i've been looking @ php since has library devoted paradox info processing while i'm confident in how write conversion code (i.e. calling few file open, close, , write functions) i'm concerned error detection , ensuring when running script, don't spend hours waiting run see 16k corrupt files exported. also, i'm not sure logic loop calling files. i'm thinking of having programme generate list of files appropriate extension , looping through list, i'm not sure if that's ideal directory of size. this beingness run on local windows 7 x64 scheme xampp setup (the database internal use) i'm not sure if pure php best thou...

Covert into Cakephp query with subquery -

Covert into Cakephp query with subquery - does know how transform query: select * diminventory partnumber='350964-b22' or partnumber in (select partnumber dimparts parentpartnumber='350964-b22') in cakephp query thanks i'm not 100% you're asking yet, here's brief tutorial on cakephp querying. $this->modelname->query("select * tablename limit 2;"); you query model, utilize literal tablename. utilize sql "as" keyword rename keys of resultant array. sample results: array ( [0] => array ( [tablename] => array ( [id] => 1304 [user_id] => 759 ) ) [1] => array ( [tablename] => array ( [id] => 1305 [user_id] => 759 ) ) ) cakephp subquery

iphone - iOS display notification based on incoming phone call -

iphone - iOS display notification based on incoming phone call - is possible have background app display notification based on contact details incoming caller, either before phone call answered or during? no, scheme not allow interact phone calls in way. iphone ios contacts telephony

C# localization -

C# localization - possible duplicate: c# localization , confusing me could please share localization steps huge c# applications? i'm pretty sure basic resource-based strategy might work when talking little medium projects. however, if speak big products, approach should paired custom build steps , 3rd party applications used linguists. so, please advise / share global localization strategy used in applications (big enough, :) thank you. basic resource-based strategy works in big enterprise applications. built-in , understandable solution, hence each , every programmer utilize without problem. the problem is, need somehow transform resource files translation memory files (i.e. tmx) , - translators utilize standard tools. so need localization process. different big applications? well, if set-up right process scale. onto process. point of view should this: copy resource files appropriate folder construction (localization engineers should...

how to create a fragment in android 3.1? -

how to create a fragment in android 3.1? - i want create fragment application. have book talks activity not @ all. wondering write little tutorial on how create 1 , how show info sqlite database in list view in it? i have not seen improve explanation official one: http://developer.android.com/guide/topics/fundamentals/fragments.html android

Receiving Arguments via Pointers in Python -

Receiving Arguments via Pointers in Python - i have class function defined this. intention send multiple arguments . for testing ,i called :class_name("argument1","argument2") , says , _init_accepts atmost 1 arguments , 3 given def __init__(self, **options): name in options: self.__dict__[name] = options[name] what proper way handle ? any suggestions welcome...... you want utilize 1 asterisk instead of two. double asterisks named arguments. there nice explanation in python documentation if interested in reading further. def __init__(self, *options): name in options: self.__dict__[name] = name however, code think real issue calling function incorrectly. you want phone call like: class_name(argument1="some value") def __init__(self, **options): name,val in options.iteritems(): self.__dict__[name] = val python arguments

javascript - Problem in getting right result for select box -

javascript - Problem in getting right result for select box - i have implemented solr search results. want display results based on sort criteria. in user interface created select box user give select criteria. problem each time user selects, results appended in webpage (for illustration if got 5 results in first select got 9 results 2nd select in sec select expect 4) want display 4 results. can problem? for code please @ problem in getting right result select box your jquery code other thread indicates repeatedly adding tables bottom of #result, on line: $("#result").append(html); you need replace results each time behavior want: $("#result").html(html); javascript jquery json solr

java - For loop causing error in Junit with Selenium while searching data in a column -

java - For loop causing error in Junit with Selenium while searching data in a column - i m getting error next loop in junit3 for(int i=9;i<=58;i++) { x = selenium.gettable("//table[4].".i.".6"); if(x == "single" || x = "onetomany") { found="true"; } else break; } can solve problem m going wrong in advance is code java code? as @matt-ball said, instead of if(x == "single" || x = "onetomany") should be if ("single".equals(x) || "onetomany".equals(x)) note, in java should not compare string == , should utilize equals() instead. also next code looks unusual me: x = selenium.gettable("//table[4].".i.".6"); is string concatenation? looks php code. think in java should this: x = selenium.gettable("//table[4]." + + ".6"); or x = selenium....

asp.net - "Invalid object name" after restoring SQL Server 2008 database -

asp.net - "Invalid object name" after restoring SQL Server 2008 database - i'm switching web host , backed database. due restriction new host not restore .bak file , had send them restore it. 1 time had restored it, ran application this system.data.sqlclient.sqlexception: invalid object name "<table name>" whenever seek query table application. however, have no problems logging in through management studio same user name , password , querying tables. i'm running mvc 3 site sql server 2008 does know why might getting these exceptions when trying run application? edit: some more information: the user name using in old db kimpo54321 tables had created got prefixed kimpo54321. tried adding first query in web app select * kimpo54321.<tablename> , query passed without exception. now did not have prefix each table name before in application , don't want apply queries. there way prepare this? edit: i ran alter schema lin...

android - how to send video stream from java to flex netstream? -

android - how to send video stream from java to flex netstream? - does know how send video info stream 1 side written java side written flex , display it? know on flex 1 method utilize netstream class real-time video stream , bind videodisplay display it. class should utilize send video stream in java , class need utilize in flex receive flow , pass netstream class? does have ideas that? thanks! check out red5 - http://www.red5.org/ it's free open source platform streaming media flash / flex. it's been around years , quite mature. telling how implement particular situation out of scope of q&a format, can tell experience red5 easy implement solution relative rolling own or flash media server (which pricey!) more tutorials , examples here: http://trac.red5.org/wiki/documentation if decide write own (why?) - check out java media framework (jmf) - http://www.oracle.com/technetwork/java/javase/specdownload-136569.html for android - you're go...

sqlite3 - sqlite date compare: Any idea why the following sqlite select with time > date('now') doesn't return the collect row? -

sqlite3 - sqlite date compare: Any idea why the following sqlite select with time > date('now') doesn't return the collect row? - tlee@tlee-vm:~/work/hl$ sqlite3 sdb/testuserssdb.db "select * users timecreate > date('now')" 1|test0@test.com|testuser|test_pass|0|2011-07-01 05:49:19.365472|2011-07-01 05:49:19.395194 2|test1@test.com|testuser1|test_pass_new|10|2011-07-01 05:49:19.376098|2011-07-01 05:49:19.394416 3|test_1@test.com|testuser_1|test_pass_1|2|2011-07-01 05:49:19.407550|2011-07-01 05:49:19.407550 tlee@tlee-vm:~/work/hl$ sqlite3 sdb/testuserssdb.db "select datetime('now'); " 2011-07-01 06:22:44 tlee@tlee-vm:~/work/hl$ sqlite3 sdb/testuserssdb.db "select * users timecreate < date('now')" tlee@tlee-vm:~/work/hl$ sqlite3 sdb/testuserssdb.db "select * users timecreate < date('now', '-5 minutes')" tlee@tlee-vm:~/work/hl$ sqlite3 sdb/testuserssdb....

internationalization - How do I make django translate certain files? -

internationalization - How do I make django translate certain files? - i'm running django-admin.py makemessages -l es within app directory create trnaslation strings. result includes texts located in app directory. templates directory app located outside app's directory. how inquire django translate template files too? i didn't want run above command within project's dir, because project contains folders not want translate. never mind, found answer. have create symlinks folders want translated (i.e. templaets) , re-create symlinks apps directory , run above command --symlinks included. django internationalization

tsql - Finding the least of three is working great, but how do I save the value to my table for each row? -

tsql - Finding the least of three is working great, but how do I save the value to my table for each row? - declare @leastof3 numeric begin tran select item#, id, market, lifo, wgtd_avg, ( case when market = wgtd_avg , wgtd_avg = lifo market when lifo = 0 , wgtd_avg = 0 , market <> 0 market when market < lifo , market < wgtd_avg , market <> 0 market when market <= wgtd_avg , lifo = 0 market when market <= lifo , wgtd_avg = 0 market when market = 0 , wgtd_avg = 0 , lifo <> 0 lifo when lifo < market , lifo < wgtd_avg , lifo <> 0 lifo when lifo <= market , wgtd_avg = 0 lifo when lifo <= wgtd_avg , market = 0 lifo when market = 0 , lifo = 0 , wgtd_avg <> 0 wgtd_avg when wgtd_avg < market , wgtd_avg < lifo , wgtd_avg <> 0 wgtd_avg when wgtd_avg <= market , lifo = 0 wgtd_avg when wgtd_avg <= lifo , ma...

Blog Plugin in zend framework 1.11.7 -

Blog Plugin in zend framework 1.11.7 - i want utilize blog plugin in zend framework 1.11.7. please give me total path can download plugin , steps implement in site. no, there isn't. there are, however, plenty of tutorials help started building one. http://akrabat.com/zend-framework-tutorial/ zend-framework

asp.net mvc - Telerik MVC Grid edit mode error -

asp.net mvc - Telerik MVC Grid edit mode error - i have form come in employee's details. in entering employee contact details , address details. address using mvc grid crud operations. selected editing mode "grideditmode.inline". there no javascript error in page loading, clicking add together new row button of grid. when focus of editable fields in row getting next error "jquery.validate.min.js:19uncaught typeerror: cannot read property 'settings' of undefined" how can rectify problem? note: using telerik extensions 2011.2.712. address grid in partial view, can utilize vendor & client address too. using ef in info layer. thanks & regards kousik the telerik controls require proper scripts registered or included in page. recommend using script registrar (something following). @(html.telerik().scriptregistrar().defaultgroup(group => grouping .add("jquery-1.5.1.min.js") .ad...

javascript - Cycle plugin: Can't insert a slide counter on slider -

javascript - Cycle plugin: Can't insert a slide counter on slider - i'm using cycle slider slide conunter. i'm having plroblems implement fadein controls on mouse over... have slider that, no slide counter... tryed implement counter on fade command slider , fade command on slide conter slider, no success... tips? here code of slider fade controls i'm trying use: http://jsfiddle.net/slcqf/1/ . cant set slide counter in that... try using pager alternative in jquery cycle. see http://jsfiddle.net/nwe44/slcqf/2/ for demo of in action based on fiddle. you'll want style bit improve beautiful border. javascript jquery slider cycle counter

iphone - Force symbolicatecrash to use a specific .app and .dSYM file? -

iphone - Force symbolicatecrash to use a specific .app and .dSYM file? - i have .crash log ad-hoc version of app symbolicatecrash refuses symbolicate. have applied .patch remove 'die' command in symbolicatecrash after apple broke script in xcode 3.2.6. symbolicatecrash has worked other crash logs refuses symbolicate one. advertisement hoc app built , stored in "archived applications", there no reason why xcode shouldn't able find it. have copied .app , .dsym files right next .crash log, no dice. is there way can forcefulness symobolicatecrash utilize specific .app , .dsym files if doesn't think applies? turns out accidentally deleted build associated crash log. symbolicatecrash uses next logic figure out if there symbols associated crash log: at bottom of every crash log list of binary images. yours listed first. there guid associated binary image. example: 0x1000 - 0x2befff +myapp armv7 <a95274a309d73458a40cb5a6fd317a1c> /var/m...

c# - Adding handlers for some field values and other extension points -

c# - Adding handlers for some field values and other extension points - i building application datamodel fixed, people (or me) can extend adding classes inherit base of operations class gets instantiated info in db , serialized in services. i have 3 problem areas (case 1 2 , 3 in sample code below). case #1 maybe solve interface, doesn't help me case 2 or 3. i think code sample speak improve attempts explain; idead on how approach each new field type doesn't need manually added bunch of places in code? public class managerclass { public managerclass() { public managerclass() { } //case #1 public void process(allfields allfields) { foreach (field field in allfields.fields) { //currently need add together extention types seperate cases here manually //...this type of logic appears in several places in code if (field.gettype().name ==...

apache - Speeding up file downloads from web server -

apache - Speeding up file downloads from web server - how optimize server server file downloads, apart buying faster network plan? files static , stored in folder is. .htaccess file ensures files forced download rather effort open in browser. recommended utilize cdn? a cdn way performance, cost makes sense quite big volumes. what kind of files serving? if they're compressible (eg html, word processor documents, pdfs; not jpegs), create sure compression enabled - utilize mod_deflate. apache optimization download

c# - LINQ or something else? -

c# - LINQ or something else? - i left little company writing .net mvc apps using linq2sql info access take new position. here still using web forms , in house written orm, looking move mvc , possible linq2sql here in near future. liked linq2sql except problems run when create changes table (adding column or something) , having regenerate dbml file everytime. 1) has issue been worked out or know if microsoft planning on resolving issue? 2) if going utilize other linq2sql here our new info access layer, everyone's suggestions be? the current ms force towards entity framework. why? because, frankly, linq sql kludge thrown in due ef beingness delayed. love linq means of "iterating" (not quite true, works on rx instead of enumerations, getting bit technically specific). if want head ms heading, aim ef. i, personally, find issues in current iteration, getting better. mileage may vary. if not way info access, consider non-custom or mapper. there...

php - Doctrine 2 - MySQL data type Double in YAML -

php - Doctrine 2 - MySQL data type Double in YAML - i'm using codeigniter doctrine 2 codeigniter2. used yaml schema files define database schema. want define 2 columns in table mysql data-type double. below yaml mapping tried entities\location: type: entity table: locations fields: id: type: integer id: true generator: strategy: auto name: type: string length: 40 nullable: false longitude: type: double latitude: type: double but code throws error when seek create models yaml. entities created successfully. the error messages are: class double not exist while trying create proxies and unknown column type double requested while trying create schema in 1.2 think 'float' or 'decimal'. seek 1 of those. here's reference 1.2 docs... i'm struggling find 2.x docs same thing. http://www.doctrine-project.org/projects/orm/1.2/docs/manual/defining-mode...

python - How can I get all .log and .txt files when I SSH into a server -

python - How can I get all .log and .txt files when I SSH into a server - i'm using paramiko module log server (ssh on , sftp on others). can text , log files specific folders on server no problem. there many sub-directories have .txt , .log files. read method not take (*.txt). know way around this. here code i'm using log server , specific log: import paramiko import sys import os ssh = paramiko.sshclient() ssh.set_missing_host_key_policy(paramiko.autoaddpolicy()) ssh.connect('10.5.48.74', username='root', password='******') ftp = ssh.open_sftp() ftp.get('/var/opt/crindbios/log/crindbios.log', '.') ftp.close() acquire list of files next script. iterate on list ftp.get import paramiko import os ssh = paramiko.sshclient() ssh.set_missing_host_key_policy(paramiko.autoaddpolicy()) ssh.connect('localhost',username='****') apath = '/var/log' apattern = '"*.log"' ...

java - Is ArrayList supported in Apache Axis Web service? -

java - Is ArrayList supported in Apache Axis Web service? - i have written simple helloworld web service. takes arraylist parameter. code simple `import java.util.arraylist; public class service { public void service(arraylist<object> list) { system.out.println("hello world.."); } }` i using eclipse helios sr1 , trying geneate web service. selecting webservice implementation "service" , selecting server runtime tomcat 6.0 , webservice runtime apache axis. clicking on next gives warning service class "service" not comply 1 or more requirements of jax-rpc 1.1 specification, , may not deploy or function correctly. method "service" on service class "service" uses info type, "java.util.arraylist" , not supported jax-rpc specification. instances of type may not serialize or deserialize correctly. loss of info or finish failure of web service may result. clicking ok go on , shows more warning 1 1 ...

php - FaceBook friends.getAppUsers replacement -

php - FaceBook friends.getAppUsers replacement - i trying find friends have installed application. after doing much research found facebook has way marked legacy. is there new way via graph api? comparing uid's 1 1 people in database way slow. facebook fql queries still supported , not deprecated, run query like: select uid, name user uid in (select uid2 friend uid1 = me()) , is_app_user = 1 with url (url encode , add together users access token): https://api.facebook.com/method/fql.query?query=select uid, name user uid in (select uid2 friend uid1 = me()) , is_app_user = 1&access_token=... however have found more reliable against own database. if setup indexing , in sql statement should fast wouldn't need 1 one. php facebook sdk facebook-graph-api

ruby on rails - Product.where(:tags => nil) returns empty results, yet it should have thousands of records -

ruby on rails - Product.where(:tags => nil) returns empty results, yet it should have thousands of records - weird one. have model product.rb, have 10k products. have title, description, link, brand , tag columns. product.where(:tags => nil) doesn't work, not via console or via method in model. is ridiculously simple i'm doing wrong? (i haven't got code can include, literally simple 1 single command wont work :/) thanks, geoff when product has no tags, store null values in tags column or store empty string? seek this: product.where(:tags => "") if doesn't work seek running these sql queries , tell results are: select * products tags null; select * products tags = ""; ruby-on-rails

java - File uploading issue in struts 2 -

java - File uploading issue in struts 2 - i have issue when uploading file in struts 2. used encoding type of jsp form follows multipart/form-data. when upload file , click submit button ,struts.xml returns action not reach method in action class. issue comes whether file upload or not when using encoding type multipart/form-data in jsp form. <form action="createtemp" id="registration" name="registration" validate="true" method="post" enctype="multipart/form-data"> can please pay attending issue , provide solution. all required file variables missing on action side i.e. having interceptor issue(not fileupload interceptor). here working illustration on how upload file in struts2. java web-applications file-upload struts2

php - Divs are overlapping on accident -

php - Divs are overlapping on accident - i have posts echoed out of mysql database. if there more one, echoed in separate divs in order of decreasing rank number (taken db). however, when divs echoed, overlap on top. believe css problem. thing each div has several sub divs. think "position" attribute might have contributed this. each div echoed out 100px between each one. thanks. code: $post = array(); $f=0; while ($row=mysql_fetch_assoc($g)){ $post[]=$row['post']; echo "<div id='area'>"; echo "<div id='badge'><span style='color: gray;'>answered by:</span>"; include 'badge.php'; echo "</div>"; echo "<div id='areapost'><pre>$post[$f]</pre></div>"; $f++; } echo "</div>"; /*end area*/ css code: #area { background-color: #fff; border: 1px solid red; width:500px; height: 300px; ...

javascript - Rails: JS Controller Being Called Twice for Some Reason -

javascript - Rails: JS Controller Being Called Twice for Some Reason - for reason when click on button, controller , resulting jquery function gets called twice. since js function beingness called toggle, problem causes code jump in , out of view. here form: unseen notifications: <%= current_user.notification_unseen %> </div> <%= button_to "show", {:action => "seen", :controller=>"notifications"}, :remote => true %> here controller: def seen respond_to |format| format.js end end here jquery: $("div#notifications").toggle(); $("div#count").html("<%= escape_javascript( render :partial => 'notifications/count')%>"); i @ loss why on earth perchance happen. have been careful not double click , don't know how prevent it. suggestions appreicated. i had recent problem before, when had 2 jquery libraries included. in pa...

typeclass - Haskell typeclasses with algebraic data types -

typeclass - Haskell typeclasses with algebraic data types - i have algebraic info types a, b, , c each implements class: class dog dog :: -> bool if create new algebraic info type: data d = | b | c is there easy way have d implement dog without having redefine each instance a, b , c again? thanks before answering, should point out may falling mutual beginner's misconception adt's. remember, haskell has 2 separate namespaces type , term levels. if write: data = foo info b = bar info c = baz info d = | b | c ...then there's no connection between type a , constructor a of type d . hence suspect (but not totally sure!) question meant inquire had next format type d , instead: data d = a | b b | c c in case, short reply "no". might wish tack on deriving dog or such thing , done, facility not provided language. said, there packages generic programming help: check hackage packages list , search "deriv...

c# - SqlCommand SQL statement being executed twice -

c# - SqlCommand SQL statement being executed twice - i'm creating asp.net app using c# , every time seek sql insert using sqlcommand, command executed twice. implemented in post (sql insert query executed twice), still doesn't help. here code: protected void btn_add_click(object sender, eventargs e) { error.innerhtml = "&nbsp;"; sqlconnection myconn = new sqlconnection("data source=.\\sqlexpress;" + "initial catalog=simon;" + "persist security info=true;" + "user id=username;password=password"); string sqlstatement = @"insert [network_equipment] " + "([network_equipment_name], [network_equipment_type_id], [ip_address], [fqdn], [netbios_name], [building_id], [description])" + " values " + "(@network_equipment_name, @network_equipment_type_id, @ip_address, @fqdn, @netbios_name, @build...