Posts

Showing posts from February, 2015

html - Use text-overflow: ellipsis on an anchor tag -

how can make <a> tag use text-overflow: ellipsis property? have long link names truncate. here attempt using usual text-overflow approach. http://jsfiddle.net/2wg8n/ you'll need change display: block; or else inline-block , specify width, e.g: a { width: 50px; display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }

jquery - Setting Value or Text to an Unknown Element -

i'm trying set value of element, if value can't set (because it's not input element such input, select or textarea) must element can populated text() var someval = "my value"; //try , set value $("#some_el").val(someval); // if couldn't set $("#some_el").text(someval); something that. there method allow me in jquery? thanks you can chain methods, jquery checks internally, 1 of methods work: $("#some_el").val(someval).text(someval); http://jsfiddle.net/3btty/ another option checking whether selected dom element has specific property value or textcontent or not, allows use text or val method getter: var $elem = $('#some_el'), method = 'value' in $elem[0] ? 'val' : 'text'; var value = $elem[method](); note method works 1 selected element, more 1 selected element can use .each() method. http://jsfiddle.net/htuns/

requirejs - proper way of using require.js -

//some.html <script data-main="./scripts/main.js" src="./scripts/lib/require.js" ></script> <script src="./scripts/multiply.js"> //multiply.js define('main'.['jquery'], function($){ $(document).ready(, function(){ var sum = 1*1; $('#some').val(sum); }) } did use require.js correctly? adding each new external script(example multiply.js), declare new location in some.html, or defeat purpose of require.js? guideline great you not need add script tag each file load. job of requirejs. proper way: //some.html <script data-main="./scripts/main.js" src="./scripts/lib/require.js" ></script> // main js should load multiply you: define(['./multiply'], function(multiply){ } //multiply.js define(['jquery'], function($){ $(document).ready( function(){ var sum = 1*1; $('#some').val(sum); }) }

sorting - C# List<string> sort issue -

i have list looks like: list<string> newlist = new list<string>() { "10s", "xs", "80", "5s", "160", "40s", "80s", "std", "40", "xxs" }; and want sort { "40", "80", "160", "5s", "10s", "40s", "80s", "std", "xs", "xxs" }; how should it? hope can me on issue, lot! list<string> list = new list<string>() { "10s", "xs", "80", "5s", "160", "40s", "80s", "std", "40", "xxs" }; // filter out numbers: int temp; var newlist = (from item in list int.tryparse(item, out temp) select item).tolist(); // sort number , string: newlist = newlist.select(x => int.parse(x)).orderby(x => x).select(x => x.tostring()).tolist(); // sort rest string: var second...

c# - Check connection time out, preferable check using long elapsedTicks or DateTime elapsedTime? -

tcp server send data buffer , mainform receive data buffer , processing i have parameter check time on lastdatareceive (from tcp) on buffer. i have paramter check time on datareceivenow (from buffer) on mainform. now, want calculate elasped time, if lastdatareceive (from tcp) - datareceivenow (from buffer) > 60 seconds, prompt messagebox.show(" connection time out "); i have 2 method on doing it, don't know 1 gives best result or both same? 1st method: elasped time using datetime format , check condition of 1 second private void checkconnectiontimeout() { if (datetime.now.subtract(receiver.lastdatareceivedtime).totalseconds > 60) { messagebox.show("connection out"); } else { // ever } } 2nd method: elasped time calculating elapsedticks private void checkconnectiontimeout() { long datatimeout = (long)timespan.fromticks(receiver.lastdatatick - datareceiveticknow).totalseconds; datetime dt...

checkbox handling in yii framework -

i try make checkboxes in yii framework foreach , code write <?php foreach ($similaredu $value) { $checkboxname = $value['checkboxname']; $checkboxid = $value['checkboxid']; ?> <?php echo $form->labelex($model,$checkboxname); ?> <?php echo $form->checkbox($model,'check[]', array('value'=>$checkboxid)); ?> <?php echo $form->error($model,'check'); ?> <?php } ?> for particular case checked checkboxes , try value of them , getting : array ( [similarform] => array ( [check] => array ( [0] => 0 [1] => 20800 [2] => 0 [3] => 20801 [4] => 0 [5] => 20803 [6] => 0 [7] => 20804 [8] => 0 [9] =...

pthreads - Calling MPI functions from multiple threads -

i want implement following thing using mpi , pthreads facing error: each processor have 2 threads. each processor's 1 thread sending data other processors , other thread receiving data other processors. when implementing it, giving segmentation fault error messages "current bytes -40, total bytes 0, remote id 5". just testing purpose, when using 1 thread per processor , either sending or receiving data, errors not occur. i found info "in general, there may problems if multiple threads make mpi calls. program may fail or behave unexpectedly. if mpi calls must made within thread, should made 1 thread." in following link: https://computing.llnl.gov/tutorials/pthreads/ i want use 2 threads per processor 1 thread use mpi_send function send data , other thread receive mpi_recv function receive data without using locking mechanism. has idea how implement or how use multiple threads call mpi functions without using mutex or locking mechanism? here code: ...

jruby dragonfly gem - "incompatible character encodings: UTF-8 and ASCII-8BIT" when open file with special characters -

i'm newbie in jruby, i'm working on jruby app use dragonfly gem handle image upload. the problem here when uploading zip file (called abc.zip) containing file name "nür ümläütö.png", .png file first stored in /tmp directory. gem instead of looking path "/tmp/nür ümläütö.png.4483.14119", looks path "/tmp/n\u00c3\u0083\u00c2\u00bcr \u00c3\u0083\u00c2\u00bcml\u00c3\u0083\u00c2\u00a4\u00c3\u0083\u00c2\u00bct\u00c3\u0083\u00c2\u00b6.png.4483.14119" doesn't exist. , doesn't happen if use native ruby. have done lots of googling on last 2 days no progress i don't know , why problem happens, please shed lights me!

ios - Line appears after animating UILabel -

Image
i performing 2 animations on myuilabel. myuilable custome class derived uilabel , have implemented drawrect method draws borders only. this animation code: - (void)animatelablein { uiviewanimationoptions options = uiviewanimationoptionbeginfromcurrentstate|uiviewanimationoptionallowuserinteraction; [uiview animatewithduration:0.1f delay:0.0 options:options animations:^{ label.transform = cgaffinetransformmakescale(1.1f, 1.1f); } completion:^(bool finished) { if (finished) { [self animatelableout]; } }]; } - (void)animatelableout { uiviewanimationoptions options = uiviewanimationoptionbeginfromcurrentstate|uiviewanimationoptionallowuserinteraction; [uiview animatewithduration:0.1f delay:0.0 options:options animations:^{ label.transform = cgaffinetransformmakescale(1.0f, 1.0f); } completion:^(bool finished) { if (finished) { } }]; } at start of first animation grey line appears on ...

python - IndexError: list assignment index out of range (in __init__) -

this question has answer here: indexerror: list assignment index out of range 8 answers due recent interest in information security , network programming, i've decided learn python through internet. i'm trying write piece of code allow user store biodata(name, age , job) of desired number of people. , o/p consist of biodata of of people along people count. being new python, i'm not able identify error. - sid here's code: #!/usr/bin/python class bio: counts = 0 mybio = [] def __init__(self, name, age, job): bio.mybio[bio.counts] = name bio.mybio[bio.counts+1] = age bio.mybio[bio.counts+2] = job bio.counts + 1 def display(self): mybio in range(0, bio.counts): print mybio while 1: name = raw_input("enter name: ...

android - How do I Google Search within my app from multiple text inputs -

i'm trying build app in user inputs ingredients multiple text fields displayed within app. when user presses enter of text formatted google search, app open default web-browser on users phone , display google search recipes containing ingredients entered. so far i've tried google custom search engine , i've been searching internet hours on how go building this. input or expertise may have me appreciated. you can open intent specified url intent myintent = new intent(intent.action_view, uri.parse(strurl)); startactivity(myintent); strurl can constructed appending google.com/search?q=searchstring1+searchstring2 to search string edit: text1=edittext1.gettext(); , on can text different text inputs strurl=text1 + "+" + "text2" + "+" + text3;

javascript - Persistent Qtip -

i want use qtip2 display persistent tool tip. persistent mean tool tip should shown when page loading , should neither hidden nor destroyed lifetime of page. have tried solution here did not work me. in code can refer @ jsfiddle here , tool tip still hidden when target moused over. want behavior off tool tip stays in place. for reference,to me,code: <html> <head> <link href="http://craigsworks.com/projects/qtip_new/packages/nightly/jquery.qtip.css" rel="stylesheet" /> <link href="mycss2.css" rel="stylesheet" /> <style> #demo-simple{ margin:100px; border:1px red solid; } </style> </head> <body> <div id="demo-simple" class="box"> <div id="primary"> hello world </div> </div> <script type="text/javascript" src="http://code....

iphone - Calabash, Detect UIButton pressed state -

i want know there way detect uibutton state calabash/ruby. ex. imagine have iphone app contains view round rect uibutton. button hold state(if pressed it, on pressed state until pressed again). want know how verify state of button calabash test given go home screen should see "name" button pressed seems found way it. ruby step functions is then /^i should see "([^\"]*)" pressed$/ |text| state = query("button marked:'#{text}'", :isselected)[0] state = state.to_i if state!=1 screenshot_and_raise "current state not pressed button: #{text}" end sleep(step_pause) end which goes steps.rb file and in calabash feature file can call it then should see "namebtn" pressed if found improvements please add. thanks

regex - perl Match multiline pattern in a file -

i have program reads file line line , gets data when pattern matched. extracts patterns like function abc (int a, int b) have functions like function xyz (int a, \n int b) doesn't match due file being read line line. is possible read file in better way or should use obvious technique of getting multiple lines. you'll need read multiple lines in @ once. if file isn't large can slurp entire file in (e.g. http://www.perl.com/pub/2003/11/21/slurp.html ) , use single line regex (use s option e.g. /stuff.next line/s). edit example multiple matches* g option allows matches. 1 sample usage in while loop, each time evaluate regex next match. see perl iterate through each match more details , examples. while($string=~/(regex)/g){ dosomething($1); } edit fixed error

python - I get "undefined variable" from pydev with the code below. Can someone please tell me what's wrong -

this code i've written. i'm beginner @ python , part of first practice. so, problem i'm getting "undefined variable" error dieface1 , dieface2 in last line of code here. def rolldie(): die1 = [1,2,3,4,5,6] die2 = [1,2,3,4,5,6] dieface1 = int(random.shuffle(die1)) dieface2 = int(random.shuffle(die2)) diefacetotal = dieface1+dieface2 while (userin > pot or userin < 0): userin = (raw_input(" invalid bet, please enter right bet amount")) print "you rolled ", dieface1, "and ", dieface2 random.shuffle() not return anything. in code, should getting like: typeerror: int() argument must string or number, not 'nonetype' simply, random.shuffle(die1) on own line. isn't needed in case: if want random value list, use random.choice() : dieface1 = random.choice(die1)

working in visual studio 2010 on windows xp -

i working on source files on windows 7. reasons need work on source file in windows xp. doubt if batch files work or not? there problem if change platform windows 7 xp? please suggest. you can use visual studio 2010 without problem on windows xp (with sp3), since officially supported os (see http://go.microsoft.com/fwlink/?linkid=133421 ). of course, windows has developed lot since xp released. take example improvements in technologies such wpf, ide work faster , more stable on newer operating systems; won't prevent using on xp. if referring batch files wrote yourself, should ensure functions suported under xp , work expected, since tools have been have been added or changed in windows 7 (for examples see here ).

gsm - output of AT command c++ code -

i wrote following code sends simple message mobile gsm sm5100b. not work. check outputs of each printf line c++ code. example at+cmfg=1 ok at+cmgs="69******" ok etc. there why implement this? my code #include <stdio.h> // standard input / output functions #include <string.h> // string function definitions #include <unistd.h> // unix standard function definitions #include <fcntl.h> // file control definitions #include <errno.h> // error number definitions #include <termios.h> // posix terminal control definitionss #include <time.h> // time calls int open_port(void) { int fd; // file description serial port fd = open("/dev/ttyama0", o_rdwr | o_noctty | o_ndelay); if(fd == -1) // if open unsucessful { printf("open_port: unable open /dev/ttyama0. \n"); } else { fcntl(fd, f_setfl, 0); printf("port open.\n"); } return(fd); } //open_port int configure_port(int fd) // configure ...

c++ - Instantiate a class in exported DLL function using getProcAddress -

i have following .h code dll , using getprocaddress consume dll in code. // mathfuncsdll.h #ifdef mathfuncsdll_exports #define mathfuncsdll_api __declspec(dllexport) #else #define mathfuncsdll_api __declspec(dllimport) #endif namespace mathfuncs { // class exported mathfuncsdll.dll class mymathfuncs { public: int x = 10; mymathfuncs(); // returns + b + x mathfuncsdll_api double add(double a, double b); }; } and corresponding .cpp code // mathfuncsdll.cpp : defines exported functions dll application. // #include "stdafx.h" #include "mathfuncsdll.h" #include <stdexcept> using namespace std; namespace mathfuncs { mymathfuncs ::mymathfuncs() { x = 10; } double mymathfuncs::add(double a, double b) { return + b + x; } } the function add exported , adds , b along initial value of x = 10. i have created dll file of same , calling functions u...

c# - Getting specific column name of a table -

Image
i working on project , got stuck query in want specific column name of table value "no." i have table name subscription , has 4 fields; id( integer ), email( varchar ), sms( varchar ), phone( varchar ) , email, sms , phone field have values either 'yes' or 'no'. now want retrieve name of columns has value 'no' . want execute query in mysql. i have tried following query returning me complete row wherever there 1 occurence of 'no' : select * test.subscription 'no' in (email,sms,phone); like have these 2 rows want select column name value='no' , id=1 how cheap , cheerful using case statement like: select id, 'colname' = case when email = 'no' 'email' end, 'colname2' = case when sms = 'no' 'sms' end, 'colname3' = case when phone = 'no' 'phone' end subscription id = 2

sql - Inserting alphanumeric characters into ms-access database using asp classic -

i having trouble when try introduce alphanumeric characters ms-access database. able numerical , date characters, seems problem alphanumerical ones, here code use: dim adocon dim strsql set adocon=server.createobject("adodb.connection") adocon.open "provider=microsoft.jet.oledb.4.0; data source=" & server.mappath("basededades.mdb") 'here getting values passed form. stringentrada=request.form("stringentrada") stringsortida=request.form("stringsortida") valoridhabitaciolliure=request.form("valoridhabitaciolliure") numeropersones=request.form("numeropersones") nom=request.form("nom") dni=request.form("dni") tlf=request.form("tlf") mail=request.form("mail") ciutat=request.form("ciutat") tipush=request.form("tipush") diareserva=request.form("diareserva") mail,nom,ciutat,tipush,dni,valoridhabitaciolliure alphanume...

c# - Devexpress xaf modules -

using devexpress 12.2.x lets create cross platform application. someapp following projects created: someapp.module someapp.module.web someapp.module.win someapp.web someapp.win now each of .module projects contains xafml file. so far i've made changes in someapp.module project, i've been wondering effect/purpose of making changes in e.g. someapp.module.win project. whats differences between xafml files , when make changes in 1 , not other? refer application solution structure a application solution contains following: windows forms application project - code, specific windows forms version of application. web application project - code, specific browser-based interface. module project - use assembly implement ui-independent application elements. example, in can define business model. subsequently, both windows forms , asp.net web applications have similar business model. windows forms module project - use assembly implement application elements...

bash - Replacing a line from multiple files, limiting to a line number range -

i have large number of files , want replace lines of these files. don't know exact contents of lines, know of them contain 2 known words - let's example 'programmer' , 'bob'. lines want replace like: created programmer bob programmer extraordinaire bob, such awesome guy copyright programmer bob, rights reserved so far sounds easy, problem want replace lines contained within line range - example in beginning of file (where typically 1 find comments regarding file). can't replace lines found in later parts of file, because don't want accidentally replace actual code. so far have tried: find . -exec grep -il -e 'programmer.*bob' {} \; | xargs sed -i '1,10 /programmer.*bob/ic\line replaced' (i'm using find because grep ran infinite recursion - think. not point here.) however seems can't use address ranges c\ (change line). feel free point out syntax errors, think i've tried no avail. work without line numbers. ed...

wpf - Bind to static generic instance of a class -

i use code in views' (which usercontrol ) constructors: this.datacontext = the<chart1viewmodel>.instance; where the<> generic static per-type singleton storage needs to implement inotifypropertychanged notify of it's instance replacement. i xaml code like, how can that? have never before did bind generic static classes. if can't, how create binding static class' instance property? as far know you'll have problems using generics in xaml. nevertheless can use static classes. wrapping property around generic this: <control datacontext="{x:static the.chart1viewmodel.instance}" />

java - achartengine : how to repaint / redraw chart -

i want repaint chart everytime choose 1 of m adapter, first time graph drawn looks perfect, when go choose 1 , come looks draws 2 times same graph. this source code : public class mainactivity extends activity { private button btnconnect; private spinner spntime; private string[] durationdata = new string[]{ "pilih durasi", "1 minggu", "1 bulan", "3 bulan", "9 bulan", "12 bulan" }; int period = 0; private linearlayout lnchart; private progressdialog dialog; public string baseurl = "http://www.abcj.com/i="; private arraylist<dataitem> listdata; //chart variables public static final string type = "type"; private xymultipleseriesdataset mdataset = new xymultipleseriesdataset(); private xymultipleseriesrenderer mrenderer = new xymultipleseriesrenderer(); private xyseries mcurr...

c# - Control not visible even ctrl.Visible = true -

i use following code (c#, net4) update visibility of label (its not visible): task.factory.startnew(() => { this.begininvoke(new action(() => { lbnumberimages.visible = true; })); }). continuewith ((task) => { try { task.wait(); } catch (aggregateexception ae) { messagebox.show(ae.innerexception.message); })); } }); if form visible label gets visible. if form not visible label remains hidden when form gets visible. wrong code? the code called - if set breakpoint on line 'lbnumberimages.visible = true;' debugger stops.

Sharepoint to sharepoint -

background i'm not sharepoint developer , looking overview solution. have 2 internal sharepoint sites. 1 document repository , other intranet. question what need provide highlevel solution on technology use enable intranet fetch documents document repository. preferrably authentication should flow, giving user single sign on. we're using ntlm internally. thanks there many options: 1- open source document library in explorer, copy documents , paste in destination document library in intranet site! simple, isn't automatic method! 2- use powershell, link helpful: https://gallery.technet.microsoft.com/office/copy-all-sharepoint-files-0999c53f 3- personally, did task programmatically using vs 4- i'm not sure may can bcd(business connectivity data)

How to extract the following HTML snippet with Python -

i have following python code: def getaddress(text): text = re.sub('\t', '', text) text = re.sub('\n', '', text) blocks = re.findall('<div class="result-box" itemscope itemtype="http://schema.org/localbusiness">([a-za-z0-9 ",;:\.#&_=()\'<>/\\\t\n\-]*)</span>follow company</span>', text) name = '' strasse = '' locality = '' plz = '' region = '' = 0 block in blocks: names = re.findall('class="url">(.*)</a>', block) strassen = re.findall('<span itemprop="streetaddress">([a-za-z0-9 ,;:\.&#]*)</span>', block) localities = re.findall('<span itemprop="addresslocality">([a-za-z0-9 ,;:&]*)</span>', block) plzs = re.findall('<span itemprop="postalcode">([0-9]*)</span...

javascript - how to recursively create a tree of links to any files in a specific folder in docpad -

i'm new docpad , know how can recursively create tree of links files in specific folder in docpad thanks we can use getfilesatpath template helper . eco this: <% file in @getfilesatpath('blah').tojson(): %> <a href="<%= file.url %>"><%= file.name %></a> <% end %>

ios - Core Data - database not found when Updating App on App Store -

we have app on app store. put new version uses preloaded core data database. when user fresh install of new version, there no problem. when user updates previous version, there issue. app appears blank , it's if can't find core data database. i thought there migration issues when changing core data model. there migration issues should out when updated existing app using no core data using core data? any advice appreciated. thanks

java - checking the value of the string parameter -

i have query , have method in recieved string parameter named head shown below private string abcd( string head) { // inside method } now calling abcd method can pass different string value head parameter inside abcd method let if(head ="sgh") have perform , if value of head someother value let s="gfew" have nothing. please advsie how can check string head getting value sgh string. try following: if ("sgh".equalsignorecase(head)) { // } else if ("gfew".equalsignorecase(head)) { // other } else ... // , on if you're using java 7, though, can use switch statement string objects. switch (head) { case "sgh" : { //do } case "gfew" : { // someting else } .. }

javascript class not working when written to div using getElementById -

i have been using datepicker js class known tcal. after link class on server, can call 1 line of code. in header <link rel="stylesheet" type="text/css" href="tcal.css" /> <script type="text/javascript" src="tcal.js"></script> html pick date: <input type="text" size=8 name="eventdate" class="tcal" value=> it has been working fine. however, streamline page, trying take out of html , display in div when user clicks on using getelementbyid. while can display input box ok, when written browser way, class no longer seems work. js function pickdate() { document.getelementbyid('show').innerhtml = 'pick date: <input type="text" size=8 name="eventdate" class="tcal" value=>'; } html <a href="javascript:void();" onclick="pickdate();">pick date</a><div id="show"></div...

how to close infowindow in google maps v3 -

i have tried implement last code @ https://developers.google.com/maps/articles/phpsqlinfo_v3 i want have cancel , close button. so, modified code , uploaded http://adsany.com/testclose.htm (view source) when click on map, marker appears, when click on marker, infowindow appears. when click on cancel , close button, closes window, new marker appears. so, want close infowindow without creating new marker. please suggest. thanks. hope link solve problem :- http://gmaps-samples-v3.googlecode.com/svn/trunk/single-infowindow/single-infowindow.html. <html> <head> <title>single info windows</title> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> google.maps.event.adddomlistener(window, 'load', funct...

android - Delaying a Task and showing progress bar -

i seem going round in circles. have code on galaxy s3 takes few seconds run. drags data database. want add progress bar popup (spinning circle) around give user app doing something. have tried asyntasks elsewhere in app , work fine type main ui not waiting asyntask finish before moving on , new activity called not have data needs , crashes. is asynctask best way round or there easier way puase main activity, show progress bar , move on once long deley has been completed. thanks time update public class updatedetailsasynctask extends asynctask<void, void, boolean> { private context context; private taskcallback callback; private arraylist<object> object; private progressdialog progress; public updatedetailsasynctask ( context pcontext, arraylist<object> pobject, taskcallback pcallback) { context = pcontext; callback = pcallback; object = pobject; } @override...

java - Two different string pass from android to pc by single toggle button using wifi -

in android project, have passed 2 strings[(tv on(by button 1) , tv off(by button 2)] android phone pc 2 simple button using wifi.but here need pass 2 strings using single toggle button [(tv on(click on toggle button) , tv off(again click on toggle button)] instead of 2 simple button(which mentioned above). sorry bad english. in adv. java code- package com.example.wifitoggle; import java.io.ioexception; import java.io.printwriter; import java.net.socket; import java.net.unknownhostexception; import android.widget.togglebutton; import android.os.bundle; import android.app.activity; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; public class mainactivity extends activity { private socket client; private printwriter printwriter; private button button; private button button1; private togglebutton togglebutton1; private string messsage;...

java - Spring MVC No handler found -

i'm newbie spring mvc , trying develop basic login webapp. below error while running project. have tried , not fix error since last 2 weeks. please can me. may 21, 2013 2:37:12 pm org.springframework.web.servlet.dispatcherservlet nohandlerfound warning: no mapping found http request uri [/springweb/web-inf/jsp/loginnn.jsp] in dispatcherservlet name 'spring' my jsp pages resides under web-inf/jsp. method loginpage in controller gettting invoked view name not being rendered , resolved. appreciate help. web.xml <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="webapp_id" version="2.5"> <display-name>testsprin...

php - Why the need for safe wakeup and clone methods in doctrine 2? -

the documentation warns few times ensuring wakeup , clone implementations on doctrine 2 entities, e.g.: http://docs.doctrine-project.org/en/latest/cookbook/implementing-wakeup-or-clone.html it doesn't why, however... presume has not messing doctrine's entity manager , in-memory-cache might maintain, cursory dive (enormous) code base doesn't more, nor did quick search of users list. might knowledgeable doctrine internals know precisely why doctrine 2 needs safe wakeup , clone methods on entities? doctrine 2 needs convert data fetched database entities (php objects). process called hydration. doctrine 2 doesn't use traditional method of using new operator (thus constructing class), uses following method: it builds string represents serialized empty version of class. it unserializes string make actual object. why need safely implement __wakeup . it stores object prototype. this process done once each entity class. then whenever needs hydrate...

php - Use Redis for a timeout queue or leaderboard -

i want use redis this, if (hypothetically) accepted sql: select id, data, processing_due qtable processing_due < now() where processing_due integer timestamp of sort. the idea remove completed "jobs" like: delete qtable id = $someid which redis commands use on producing ("insert") , consuming ("select, delete from") end? i find redis can used queue, don't want answers in strictly order inserted, rather based on if "now" past processing_due . i imagine same problem leaderboard? (i try wrap head around how redis works , looks simple enough documentation, don't it.) would decent solution zadd qtable <timestamp> <uuid> , use uuid key store (json) value under it? you can use sorted set , in score time (an integer you've suggested), , query using zrangebyscore . each member json representation of "fields". example: {id:"1",data:"bla",processing_due:"3198382...

I need some help on joomla, all links redirect to homepage -

i have joomla website, working fine when sef off, when make check boxes in global configuration sef, links inside menu redirect homepage nor of page open, please give me suggestion how rid of issue. web server apache , yes .htaccess , support url rewriting. here website url, http://ushairrestoration.com have try found solution of problem, didn't find solution on internet. please share idea how can fix it. thanks in advance waheed just giggles , kicks - in config file - live site set home url, or blank? should make sure empty. have had weird things happen sef when not configured properly. you have lot of script going on - on front page. if site working without sef installed, , broken when turned on - more confict. just side note - joomla's core sef works fine. don't bother third party stuff - not need it.

How do I change current mysql database dynamically in a procedure? -

for our system using multiple databases same structure. example when have 1000 customers, there 1000 databases. we've chosen give each customers own database, can delete data @ once without hassle. now have update database structure several times year. began write stored procedure loops through schemas. got stuck executing dynamic use statement. my code follows: declare v_schema varchar(100); set v_schema = 'someschemaname'; set @querystring = concat('use ', v_schema); prepare s @querystring; execute s; deallocate prepare s; when execute code error says error code: 1295. command not supported in prepared statement protocol yet . assume cannot change active database in procedure. i have searched internet, thing found creating string of each alter query , prepare/execute/deallocate it. hope there better solution this. write shell script loops through schemas , executes sql file on them, prefer stored procedure takes care of this. does know how make wor...

ruby on rails - How do I parse a bit field in PHP? -

i want parse bit fields php similar this: 584392900608 this number created in rails, flagshihtzu extension. tried several php classes, couldn't decipher them. maybe bitfield.php of help? worked me.

r - how to report goodness of fit for a svyglm object? -

a question survey package in r. know basic i've found nothing. so: library(survey) data(api) dclus2 <- svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc) summary(svyglm(api00 ~ ell + meals + mobility, design = dclus2)) call: svyglm(formula = api00 ~ ell + meals + mobility, design = dclus2) survey design: svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc) coefficients: estimate std. error t value pr(>|t|) (intercept) 819.2791 21.3900 38.302 4.65e-13 *** ell -0.5167 0.3240 -1.595 0.139 meals -3.1232 0.2781 -11.231 2.29e-07 *** mobility -0.1689 0.4449 -0.380 0.711 --- signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (dispersion parameter gaussian family taken 3157.85) number of fisher scoring iterations: 2 is there r-squared or other statistic give reader impression of how model fits data? thanks. there package came out in late 2016 found called "po...

MySQL pivot query -

i used have query select ps_target_ecpm, ps_actual_ecpm publisher_stats join domain on domain.dmn_id = ps_dmn_id left join langue on langue.lng_id = domain.default_lng_id month(ps_month) = 05 the result need should may_target_ecmp, may_actual_ecpm, april_target_ecpm, april_actual_ecpm, march_target_ecpm, march_actual_ecpm. for april month(ps_month) = 04 , march month(ps_month) = 03 respectively. after questioning around ended query looks this select (case when month(ps_month) = 4 ps_target_ecpm else 0 end) april_target_ecpm, (case when month(ps_month) = 4 ps_actual_ecpm else 0 end) april_actual_ecpm, (case when month(ps_month) = 3 ps_target_ecpm else 0 end) march_target_ecpm, (case when month(ps_month) = 3 ps_actual_ecpm else 0 end) march_actual_ecpm publisher_stats join domain on domain.dmn_id = ps_dmn_id left join langue on langue.lng_id = domain.default_lng_id the resultset not quite need. example response is: 0 0 0.48 0.27 0.4...

tortoisesvn - SVN ignore *.jpg not working? -

i'm trying ignore .jpg not working. i write command svn propset svn:ignore *.jpg i want ignore jpg file. any idea how proceed? i suspect want ignored in single repository, in case @borrible's answer correct one. in case want alternative, if want .jpg files ignored globally , can in file ~/.subversion/config in file, can add value global-ignores ; global-ignores = *.jpg

vb.net - Delete multiple files -

i'm trying delete multiple files in same folder vb.net, haven't succeed yet. please? i tried dim filetodelete1 string dim filetodelete2 string dim filetodelete3 string dim filetodelete4 string dim filetodelete5 string filetodelete1 = application.startuppath & "\1.exe" filetodelete2 = application.startuppath & "\2.dll" filetodelete3 = application.startuppath & "\3.dll" filetodelete4 = application.startuppath & "\4.dll" filetodelete5 = application.startuppath & "\5.dll" if system.io.file.exists( filetodelete1 ) = true my.computer.filesystem.deletefile( filetodelete1 ) elseif system.io.file.exists( filetodelete2 ) = true my.computer.filesystem.deletefile( filetodelete2 ) elseif system.io.file.exists( filetodelete3 ) = true my.computer.filesystem.deletefile( filetodelete3 ) elseif system.io.file.exists( filetodelete4 ) = true my.computer.filesystem.deletefile( filetodelete4 ) elseif system.io.f...

nvidia - Fix for DirectX 7 latency on Windows 7? -

we have piece of software programmed against dirextx 7 sdk (i.e code uses lpdirectdrawsurface7 , likes) , runs in fullscreen. main task putting on screen in response external triggers in reliable manner. behaves on windows xp: bsically software waits trigger , when triggered, creates new frame, puts in backbuffer, tells dx flip buffers. result approximate delay between trigger , when frame shown on screen is, depending on video card , drivers, 3 frames or 50msec 60hz screen. tested on variety of systems, running nvidia cards. on systems higher end cards 2 frames. when running same software on windows 7 (with no other software installed @ all) however, cannot lower 5 frames. meaning somewhere in pipeline os or driver or both eat 2 frames, near unacceptable application. tried disabling aero/desktop composition/different driver versions/different video cards no avail. where come from? documented somewhere? is there easy way fix? know directx 7 old, upgrading compile agains mor...

database - Object Relation Class Diagram -

i designing object relational database , here class diagram: http://canning.co.nz/advanceddatabase/class_diagram.png my computer class has 1-1 relationship currentuser class. when creating object in code, computer class has currentuser object attribute (currentuser_objtyp). here code: create type computer_objtyp object ( compno number, compname varchar2(20), compos varchar2(20), compprocessor varchar2(20), compram varchar2(20), currentuser_obj currentuser_objtyp, harddrivelist_var harddrivelist_vartyp, member function getcompname return varchar2) / my question this: as computer class has attribute, computer class need attribute listed other attributes (compno, compname, compos, compprocessor, compram), or relationship link currentuser class sufficient? it depends on exact definitions of computer , currentuser. few examples: if perceive computer machine, have no current user, because needs no user @ all. users belong os. if see c...

python - delete multiple fields for a key in Redis -

i have dictionary follows: dict1 = {"a":"foo","b":"bar","c":"foobar"} the keys of dict1 fields of key in redis. want use hdel delete fields in redis. wondering if possible send multiple fields @ once redis. i thought of creating list of keys dict1 , passing redis.hdel doesn't work , returned false. appretiate help/suggestions. list1 = [] key = "somerediskey" k in dict1: list1.append(k) data = redis_connection.hdel(key, list1) the python redis lib accept hdel(name, *keys) , should do: data = redis_connection.hdel(key, *list1) also, don't need create list of keys, can use dict1.keys() : key = "somerediskey" data = redis_connection.hdel(key, *dict1.keys()) related docs: http://kushal.fedorapeople.org/redis-py/html/api.html#redis.strictredis.hdel

postgresql - Using concat() function, is specific cases -

i need concatenate regexp pattern pieces, pattern, use c-style escape e . if use concatenation operator || , works: e'a{'||2||'}' does not make sense, interes, how concatenate same, using concat() function ? the misunderstanding this: c-style escapes way input string literals. when concatenate strings, || operator or concat() function (postgres 9.1+), method how individual strings input irrelevant . in addition that, literals of other types (like numeric constant 2 in example) coerced text automatically. on top of that, example not exhibit characters special meaning in escape strings (like \ ). select e'a{' || 2 || '}'; select concat(e'a{', 2, '}'); so, e totally irrelevant in particular example. since mention regexp patterns: tend have \ in them, have escaped \ in e'' notation: select e'\\.' || 2 || '\.'; the modern way not use escape strings @ if not necessary. that...

How to add confirm message with link_to Ruby on rails -

i wanted add confirmation message on link_to function ruby. = link_to 'reset message', :action=>'reset' ,:confirm=>'are sure?' any ideas why it's not working? first, should verify layout have jquery_ujs . best practice including in main application.js : //= require jquery_ujs check included application.js in layout: = javascript_include_tag :application while, in development mode, view source html , verify jquery_ujs.js exists. run server , verify link tag has data-confirm value, example: <a href="/articles/1" data-confirm="are sure?" data-method="delete"> if steps correct, should work! note: check railscast http://railscasts.com/episodes/136-jquery-ajax-revised

vb.net - Inserting text after specific tag -

i have text file comprised of different tags. able find out if specific tag exists within document using following... public class form1 private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click dim text string = io.file.readalltext("c:\example.xtp") dim index integer = text.indexof("<tools>") if index >= 0 ' string in file, starting @ character "<tools>" insert text "test_hello" end if end sub end class however want enter text after tag when / if found i using vb.net try: private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click dim text string = io.file.readalltext("c:\example.xtp") dim index integer = text.indexof("<tools>") dim countchars integer countchars="<tools>".length if index >= 0 ' string in file, starting @ ...

Reflect Data in the Excel sheet to the android app -

i new android development. have 2 questions: i have excel sheet database data. want display data in android application. how can it? have use sqlite database? if yes, how? if there changes in excel sheet in future, how these changes reflected in application? thanks in advance help. to read excel file in android, should use excel library such jexcelapi, apache poi. after reading it, can write them sqlite dababase reduce excel parsing time. when parse excel file, save file's last modified time text file or preferences , whenever app runs, comare them , update if last modified time different.

iphone - iOS add Day View Calendar in application -

i trying make application day-view-calendar in it. know there quite few questions implicit same mine, haven't found answer makes clear me. want make day-view-calendar contains several (5 or 6) columns. can add items 5 or 6 different users in 1 view. furthermore want have lay-out similar iphone calendar day view. i totally new here, can please me how solve "issue"? i think should use tapku calendar library same view. https://github.com/devinross/tapkulibrary check may you

Change magento base URL without magento reference in the uRL -

while installing magento have set base url default installation magento directory. the base url should www.yourdomain.com/magento or www.yourip.com/magento. are there issues if set base url without magento reference (for example, http://www.yourdomain.com )? if that, have put magento installation on root directory. if put on root directory, can access magento website writing base url (www.yourdomain.com). there's no problem on working outside folder called 'magento'.

javascript - How to change the language for alerts in chosen.js? -

Image
when type in unavailable option in multiple select box in chosen.js, generate output 'no results match " query "'. there way change output language? you can set default message - // jquery version: https://github.com/harvesthq/chosen/blob/master/example.jquery.html $(".chzn-select").chosen({no_results_text: "translated no results matched"}); // prototype version: https://github.com/harvesthq/chosen/blob/master/example.proto.html new chosen($$(".chzn-select")[element_index],{no_results_text: "translated no results matched"}); except this, there doesn't seem i18n support.

what is the IDE for using SPECMAN -

i have been searching ide use in order start studying specaman. i know ide e/specman , can download ? also if there tutoriaal it. thanks in advance. this plugin eclipse costs money. http://www.dvteclipse.com/ i've never tried it. most people @ work use vim or emacs edit e-files. use jedit . here's crash-course on specman.