Posts

Showing posts from May, 2014

mysql - Key commands for creating temporary tables -

i creating temporary tables in stored procedures. wanted know commands include in procedure avoid conflicts? i use below syntax create temporary table if not exists temp_shipmentcount and use drop command @ end. should add drop command @ beginning of procedure also? temporary tables connection scoped. exist until connection closed. as per documentation on temporary tables you can use temporary keyword when creating table. temporary table visible current connection, , dropped automatically when connection closed. means 2 different connections can use same temporary table name without conflicting each other or existing non- temporary table of same name... if connection not closed shared among users, have drop , re-create. dropping database object using shared connection result issues. it better option use temporary tables runtime generated names within stored procedure. safe on using shared connection objects too. exampe : set @temp_table_n...

c# - TimeSpan? = DateTime?.Value - DateTime?.Value results in null -

Image
my datetime? value minus datetime? value resulting in null timespan? . see date values have been pinned debugger. i not replicate in console app worked same dates. date formats in dd/mm/yyyy i understand not need .value code in places. have tried without .value . post-edit timespan ts = datemodified.value - publishrecord.datepublished.value; timespan ts2 = datemodified.value.subtract(publishrecord.datepublished.value); timespan? ts3 = datemodified - publishrecord.datepublished; all attempts result in line having exception in screenshot. nullable object must have value. ... continuing dig per suggestions , show more information requested... post-edit 2: both datemodified , datepublished datetime? standard. properties auto get; set; post-edit 3 - summary i can't explain bug. system nunit tested. surprise when in tested area turns up. bug appeared during interface development , debugging attaching class library , refreshing web page. builds in both solut...

cassandra - java.sql.SQLNonTransientConnectionException: org.apache.thrift.transport.TTransportException: Frame size larger than max length (16384000)! -

i have java project in intellyj cassandra db , using maven 3 , java 7. cassandra version 2.0.6. have table near 100,000 rows. when run program exception: java.sql.sqlnontransientconnectionexception: org.apache.thrift.transport.ttransportexception: frame size (16858796) larger max length (16384000)! @ org.apache.cassandra.cql.jdbc.cassandrastatement.doexecute(cassandrastatement.java:197) @ org.apache.cassandra.cql.jdbc.cassandrastatement.executequery(cassandrastatement.java:229) @ ir.categorization.methods.featureselection.dbfeatureselection.getfeatures(dbfeatureselection.java:102) @ ir.categorization.methods.test.classifier.setfeatures(classifier.java:67) @ ir.categorization.methods.test.classifier.<init>(classifier.java:50) @ ir.categorization.methods.test.classifiertest.main(classifiertest.java:105) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodac...

c# - Linq join values from two lists -

i need extract 2 values separate lists. have list of order objects , list of visitors objects, each contains full list of objects date. i need access visitors property visitorslist , totalorders property orderslist. need devide each totalorders visitors third value (conversionrate). want add each conversionrate value list totalconversions. i'm trying write linq query takes visitors , totalorders respective i'm not sure how this. list<gavisitorsmodel> visitorslist = getgastatisticsreport(model); list<gc_ordersmodel> orderslist = getorderreport(model); list<gc_conversionratemodel> totalconversions = new list<gc_conversionratemodel>(); foreach (var order in orderslist) { string _date = order.date; var conversions = visitorslist.join(orderslist, x => x.visitors, y => y.totalorders, (x, y) => new { x = x, y = y }); foreach (var c in conversions) { ...

how to change server root in nginx? -

default server root in nginx /usr/share/nginx/html . how change /home/username/html ? i've tried add configuration in site-available didn't work! server { listen 80; root /home/username/html; index index.html index.htm; server_name mj.dev; } try restart nginx server! nginx -s restart if still work check weather load right configuration file. use nginx -t to check syntax of configuration file

canvas - Variable length arrow with FabricJS Path() -

i'm trying make variable length arrow in fabric.js using path(). new fabric.path('m 0 0 l 150 0 m 0 0 l 10 -10 m 0 0 l 10 10 z', {}); this creates fixed length arrow, i'd work follows: click on canvas, arrow tip appears (keep mouse down , drag endposition) when drag arrow endposition line gets longer tip stays same size still while dragging line stays attached point of origin , whole arrow rotates around until dragging stops can done? , how create functionality? help appreciated! edit: found fiddle http://jsfiddle.net/7a5ms/51/ i'm looking for, calculation of arrow angle off. anyone? managed code working fiddle.

cuda - remove include path in nvcc -

i trying extend vector support cuda, e.g, overriding operators in vector structures. modifying default vector_types.h file. not possible in multi-user environment don't have permission modify it. hence, decided create new vector_types.h , not include original vector_types.h. seems nvcc automatically includes file don't include in code. question is there anyway change behavior of nvcc? any appreciated. thanks you can create separate header file , include vector_types.h there: // vector_types_ext.h #include <vector_types.h> __device__ float4 operator +(float4 a, float4 b) { // ... }

dynamics crm - CRM 2011: How to update MessageProcessorMinimumInactiveSeconds field in DeploymentProperties table? -

is there supported way update value field messageprocessorminimuminactiveseconds in deploymentproperties table in mscrm_config database? i have worklfow should executed every 10 minutes . , there known problem infinite loop . created scheduled wf same way like this . also, there other solution scheduled workflows in crm? i have several suggestions how make recurrent actions in crm without touching db. you can create on-demand workflow , trigger using external application or ssis package. you can create external windows service required actions instead of crm. you can use ssis packages.

javascript - A readonly textbox should be cleared on checkbox checked -

<table> <tr> <td>value1</td> <td>value2</td> <td> <input type="text" class="textbox" value="not required" readonly=readonly /> </td> <td> <input type="checkbox" onclick="checkcheckboxes1(this)"/> </td> </tr> <tr> <td>value1</td> <td>value2</td> <td> <input type="text" class="textbox" value="not required" readonly/> </td> <td> <input type="checkbox" onclick="checkcheckboxes1(this)" /> </td> </tr> <tr> <td>value1</td> <td>value2</td> <td> <input type="text" class="textbox" value=...

c++ - How to pass array of function pointers to another function -

i have got 2 functions: char* odwroc(char* nap, int n) char* male(char* nap, int n) i have defined pointer kind functions typedef char*(*pointertofunction )( char*, int ); then in used definition in main: pointertofunction ptr1 = odwroc; pointertofunction ptr2 = male; but have create function first parameter gets array of pointers function , stuck. don't know how define array of pointers function , how modyfikuj parameter list should like. void modyfikuj(char* pointertofunction *pointerarray, int length, char* nap2, int n){ } try this: pointertofunction mojefunkcje[] = { odwroc, male}; modyfikuj( mojefunkcje, ...); // pass array fo modyfikuj() void modyfikuj( pointertofunction* funtab, ...) { funtab[0]( string, liczba); // call odwroc( string, liczba) funtab[1]( string, liczba); // call male( string, liczba) }

Make IntelliJ IDEA use a different pom file for maven project -

i have maven project imported in intellij idea. technical reasons, have 2 pom files - pom.xml , pom-local.xml . i can use alternative pom file manually using mvn -f pom-local.xml install . idea uses pom.xml can't find option change pom-local.xml . ideas how make idea use alternative pom file?

Is there a way to control the keyboard in java without awt.robot -

is there way control keyboard in java without using awt.robot? unfortunatly robot class cannot press every key on azerty layout. and need 1 of them. the solution seems code equivalent of robot in c use java call it. thanks. did know can type ascii character holding alt typing ascii code character on numberpad releasing alt you robot special characters. not sure if solves problem. eg: hold alt, type 1234 on numberpad, release alt types Ó’

multithreading - Matlab parallel programming -

first of all, sorry general title and, probably, general question. i'm facing dilemma, worked in c++ , right i'm trying similar 1 of previous projects, parallelize single-target object tracker written in matlab in order assign each concurrent thread object , gather results @ each frame. in c++, used boost thread api so, , results. possibile in matlab? reading around i'm finding rather unclear, i'm reading lot parfor loop that's pretty it? can impose synchronization barriers similar boost::barrier in order stop each thread after each frame , wait other before going next frame? basically, wish initialize common data structures , launch few parallel instances of tracker, shares data , take different objects track input. suggestion appreciated! parfor 1 piece of functionality provided parallel computing toolbox. it's simplest, , people find useful, why of resources research has found discuss that. parfor gives way parallelize "embarassing...

c# - How to create a X509 certificate from Bouncy Castle for use with AuthenticateAsServer? -

i've used bouncy castle create x509 certificate, can't use sslstream.authenticateasserver or sslstream.authenticateasclient since (of course) use .net version. although there converter , dotnetutilities.tox509certificate() , in bouncy castle takes a bc x509 , returns .net x509. problem seems authenticateasserver/authenticateasclient needs certificate private key included. @ least when try convert , use new certificate cryptographicexception: "key not exist" when trying connect using sslstream. so thought need create x509certificate2 bouncy castle, since can contain private key well. solution found seems bit...odd, , wondering if else better way use bc x509certificate sslstream. this how create x509certificate2 bc certificate: private static x509certificate createdotnetcertificate(org.bouncycastle.x509.x509certificate certificate, asymmetriccipherkeypair keypair) { var store = new pkcs12store(); string friendlyname = certificate.subjectdn.tostring();...

Getting syslog-ng json output as sensu standalone event -

could 1 please advise best way convert syslog-ng event in json (like http://hastebin.com/gesuyuluwo.json ) in sensu (critical) event? thank you. i don't know sennsu, in syslog-ng ose 3.5 can convert log messages json format: http://www.balabit.com/sites/default/files/documents/syslog-ng-ose-3.5-guides/en/syslog-ng-ose-v3.5-guide-admin/html/reference-template-functions.html#template-function-format-json hth robert

ruby on rails - undefined local variable or method `signin' for #<Class:0x31fa7f0> -

i have following error in model class. how approach such errors. class user < activerecord::base # include default devise modules. others available are: # :confirmable, :lockable, :timeoutable , :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable attr_accessor :signin validates :username, :uniqueness => {:case_sensitive => false} def self.find_first_by_auth_conditions(warden_conditions) puts warden_conditions conditions = warden_conditions.dup where(conditions).where(["lower(username) = :value or lower(email)= :value", { :value => signin.downcase }]).first end end i new rails , learning things doing. how debug such issues. if such error in model, should first look. this method devise , auth pair username , email or else. problem in signin variable use login instead code: def self.find_first_by_auth_conditions(warden_conditions...

php - To show links like previous 1 2 3 4 5.... next -

the following code show next , previous links in pagination: if( $page > 1 ) { echo '<a href="'.$_server['php_self'].'?page='.($page-1).'&date1='.$_request["date1"].'&date2='.$_request["date2"].'">previous</a>'; } if( $page < $totalpages ) { echo '<a href="'.$_server['php_self'].'?page='.($page+1).'&date1='.$_request["date1"].'&date2='.$_request["date2"].'">next</a>'; } what should show links this: previous 1 2 3 4 5..... next try below code. <?php if( $page > 1 ) { echo '<a href="'.$_server['php_self'].'?page='.($page-1).'&date1='.$_request["date1"].'&date2='.$_request["date2"].'">previous</a>'; } for( $i = 1; $i < $totalpages; $i++){ echo '<a href=...

c++ - Read all files recursevly in a directory (and subdirectories) with QT -

this question has answer here: os.walk analogue in pyqt 1 answer recursively iterate on files in directory , subdirectories in qt 3 answers i have done code in qt in order open directory dialog, choose directory , read files in it: qfiledialog dialog; dialog.setfilemode(qfiledialog::directory); dialog.setoption(qfiledialog::showdirsonly); dialog.setviewmode(qfiledialog::detail); int res = dialog.exec(); qdir directory; if (res) { directory = dialog.selectedfiles()[0]; qstringlist fileslist = directory.entrylist(qdir::files); qstring filename; foreach(filename, fileslist) { qdebug() << "filename " << filename; } } the problem able read files in subdirectories of chosen directory.. know how done?

c++ - How to create makefile build Snappy as static library -

i have files required build snappy library: snappy.h snappy.cc snappy-c.h snappy-c.cc snappy-internal.h snappy-sinksource.h snappy-sinksource..cc snappy-stubs-internal.h snappy-stubs-internal.cc snappy-stubs-public.h snappy-test.h snappy-test.cc snappy-unittest.cc how create makefile making snappy static library. i know have create .o file every .cpp file have variable , important rules. objs=snappy.o snappy-c.o snappy-sinksource.o snappy-stubs-internal.o\ snappy-test.o snappy_unittest.o cc=gcc ccflags=-wall -static $(objs): %.o:%.cc $(cc) $(ccflags) $< -o $@ clean: -rm -rf *.o .phony: clean what have next? [edit]: have now: objs=snappy.o snappy-c.o snappy-sinksource.o snappy-stubs-internal.o snappy-test.o snappy_unittest.o cc=gcc ccflags=-wall -static libname=libsnappy.a all:$(libname) $(libname): $(objs) ar rcs $@ $^ $(objs): %.o:%.cc $(cc) $(ccflags) $< -o $@ clean: -rm -rf *.o .phony: clean but still doesn't work: gcc...

symfony - Error clearing the cache -

whenever clear cache (app/console cache:clear) error: [invalidargumentexception] file "c:\wamp\www\sylius\app\cache\de_/config/config_dev.yml" not exist. my app symfony 2.3. try giving proper environment along cache:clear command. php app/console cache:clear --env=prod or php app/console cache:clear --env=dev is project working under svn? if so, try performing svn cleanup before removing cache. way, can go app/cache folder , manually delete cache in relevant environment. hope helps. cheers!

android - How to stop periodic location updates when driver goes out of vehicle? -

in truck, there app running on tablet records location every 60 seconds. i need stop periodic recording of location, once truck ends driving, further movement of tablet not considered part of route. e.g. after end of driving, possible driver walks tablet around town. my ideas solving are: a button driver has press when ends driving stop recording - easy implement, there risk driver forgets pressing button checking difference between current , previous location - e.g. when distance in meters didn't change more 20 meters in few minutes vehicle considered stopped. of course there's risk vehicle in traffic jam use activity recognition google services - use mechanism check activity , once other activity (with high enough confidence), stop recording what way suggest this? a button driver has press when ends driving stop recording - easy implement, there risk driver forgets pressing button i agree you, dangerous let deciding user action of app che...

c# - get dataItem from asp.net repeater and display on frontend code -

Image
i dont asp.net learning curve me , little stuck know should easy if know how apologies in advance: below c#: rptlistingallmandatorycourses.datasource = listingallmandatorycourses(); rptlistingallmandatorycourses.databind(); public dataset listingallmandatorycourses() { dataset dataset = new dataset(); user user = (user)context.items["currentuser"]; sqlconnection selectconnection = new sqlconnection(configurationsettings.appsettings["dbconnectstr"]); sqldataadapter adapter = new sqldataadapter("dbo.proccataloguesgetallcoursesbycategory", selectconnection); adapter.selectcommand.commandtype = commandtype.storedprocedure; // results adapter.selectcommand.parameters.add("@filterbydomain", sqldbtype.bit).value = 0; if (user.domain.guid != guid.empty) { adapter.selectcommand.parameters.add("@domainid", sqldbtype.uniqueidentifier).value = user.do...

java - Read one line at time from a file when a function is called each time -

string time=read_one_line(); public static string read_one_line() throws filenotfoundexception, ioexception { fileinputstream fin=new fileinputstream("sample.txt"); bufferedreader br=new bufferedreader(new inputstreamreader(fin)); str=br.readline(); next_line=br.readline(); return next_line; } each time should read 1 line text file called "sample.txt" , return it . next time should return next line , on.... contents of sample.txt are: date:0 year:0 hour:0 minute:0 seconds:0 milliseconds:310 date:0 year:0 hour:0 minute:0 seconds:0 milliseconds:0 date:0 year:0 hour:0 minute:0 seconds:0 milliseconds:10 date:0 year:0 hour:0 minute:0 seconds:0 milliseconds:0 date:0 year:0 hour:0 minute:0 seconds:0 milliseconds:380 date:0 year:0 hour:0 minute:0 seconds:10 milliseconds:-840 date:0 year:0 hour:0 minute:0 seconds:0 milliseconds:0 date:0 year:0 hour:0 minute:0 seconds:0 m...

Date formate in Backbone.js -

i noob in backbone.js .i want display current date in format"monday,april,14,2014".i searched could'nt proper link .it should using backbone.modal.extend .any highly apperciated. backbonejs not responsible date formatting. make own methods or use library momentjs.

javascript - Remove suggestions when inputfield is not focused -

Image
i'm creating auto complete search box. suggestions have disappear when user clicks outside search field. the form input field: <input type="text" name="naam_textbox" id="naam_textbox" class="field" autocomplete="off" onkeyup="suggest(this.value, 'naam');" onblur="fill();" /> the javascript code: function suggest(inputstring, veld){ if(veld == "naam") { if(inputstring.length < 2) { $('#suggestions_naam').fadeout(); } else { $('#naam_textbox').addclass('load'); var dropdown = $( '<div class="suggestionsbox" id="suggestions_naam" style="display: none;"><div class="suggestionlist" id="suggestionslist_naam"> &nbsp; </div></div>' ); if (inserted_naam == 0) { dropdown.insertafter( "#naam_textbox" ); inser...

json - javascript $.post returning correct result but cant catch all characters in returned string -

Image
i using $.post write result database. my syntax is: $.post('addbundle_summary', {id:id},function(resultsummary) { alert(resultsummary[0]); }) i using codeigniter , in model returning result below. note sql returns single result $stackid single number: return $stackid; my controller send function with: $this->output->set_content_type('application/json')->set_output(json_encode($data)); in developer tools, can see result function per below image even though result 23, alert showinf me 2. if result 573 alert 5. how can return entire result number , not first letter of string? alert(resultsummary[0]) returning resultsummary string @ index 0, 2 . use alert(resultsummary) instead. $.post('addbundle_summary', {id:id},function(resultsummary) { alert(resultsummary); })

jquery - why does geocomplete not trigger bounds_changed event? -

i have google map takes whole screen size. there top bar has geocomplete text field, can type in place name , map moves place. however, problem fails trigger bounds_changed event. second problem is, when map first loads, can't drag (the hand icon doesn't appear). after move other place using geocomplete field i'm able drag map. following relevant code snippet i've used. $(document).ready -> google.maps.event.addlistener window.map, "bounds_changed", -> // here fire ajax request retrieve data , display in custom overlay. if navigator.geolocation navigator.geolocation.getcurrentposition(set_user_location,error, { 'enablehighaccuracy' : 'true' }) set_user_location = (position) -> mapoptions = center: new google.maps.latlng(position.coords.latitude, position.coords.longitude) zoom: 14 window.map = new google.maps.map(document.getelementbyid("map-canvas"), mapoptions) $('.countries-dropdown').geocomplete ...

python - Pyqt4: Use of Marker Numbers in Qscintilla -

Image
i want know why marker number used , how 1 31 marker numbers different each other. , how add custom marker symbol gradient,pix map or image etc example these blue glittery dots in given image.:- marker defined in following code:- circle_marker_num = 0 ...... def __init__(self, parent=none): super(simplepythoneditor, self).__init__(parent) self.markerdefine(qsciscintilla.circle,self.circle_marker_num) self.setmarkerbackgroundcolor(qcolor(66, 66, 255),self.circle_marker_num) ...... def on_margin_clicked(self, nmargin, nline, modifiers): # toggle marker line margin clicked on if self.markersatline(nline) != 0: self.markerdelete(nline, self.circle_marker_num) else: self.markeradd(nline, self.circle_marker_num) the answer question "why marker number used" simply: why not? sort of identifier has used, , number seems reasonable choice. the markers have pre-defined meaning numbers 25 31, used fold-margin symbols. numbers 0...

java - Get Logo (image) in menudrawer android -

Image
i want place image @ bottom of menudrawer (google menu), doesn't work. have researched whole internet , tried can imagine (in java files , in xml files). still doesn't work. there example @ image below (red border): the image below app menudrawer: i appreciate help. like said before want image @ bottom of menudrawer app above. there few files related menu , in activity_main.xml got elements (like list items) of whole menu. tried place imageview in activity_main.xml not work. here stuck don't know how this. help. here code of activity_main.xml imageview have placed: <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- framelayout display fragments --> <framelayout android:id="@+id/frame_container" android:layout_width=...

ruby on rails - Capture video and audio using javascript -

i trying capture video , audio web browser , upload server. thing don't want use flash in this. so using html5 feature , library called recorderrtc make possible. using ruby on rails in backend. though feeling feature still under implementation facing challenges. following javascript code have written : http://pastebin.com/kjwunffd , here rails code : uuid = uuid.generate audio_file_name = "#{uuid}.wav" if params[:chrome] audio_file_name = "#{uuid}.ogg" if params[:firefox] video_file_name = "#{uuid}.webm" directory = "#{rails.root}/public/record" directory = directory + "/chrome" if params[:chrome] directory = directory + "/firefox" if params[:firefox] audio_path = file.join(directory, audio_file_name) video_path = file.join(directory, video_file_name) #puts params[:audioblob].tempfile.read file.open(audio_path, "wb") { |f| f.write(params[:audioblob].tempf...

visual studio export template error 'invalid parameter' -

i'm using visual studio 2012 premium on 64-bit window's 7 laptop. want export template following error when click finish in export template form: template export failed following reason: invalid parameter parameter name: index to make start project existing template (typescript nodejs; blank express application) , change how need it. delete folders , create new ones. rename startup file app.ts server.ts . can't find explaining error, , http://msdn.microsoft.com doesn't have anything, far see. if share insight how problem or how export template appreciated!

unity3d - Samsung 3D Explorer app -

i bought samsung 3d tv , develop own app displays 3d content on it. possible? i looked @ sdk provided samsung, not find related (saw playing 3d content .. nothing 3d api or develop own 3d game using unity , display in 3d manner on screen). any appreciated. thanks the 3d in tv context ( stereoscopic ) different 3d game programming ( 3 axes positioning ). to develop game or application using 3d computer graphics can webgl or opengl using pnacl interface. , displaying 3d content put 3d media (usually side-by-side type) media player , press 3d button in remote.

java - Google App Engine Task Queue not working with eclipse plugin: org.quartz.SchedulerConfigException: Unable to instantiate class load helper class -

Image
i trying implement gae task queue spring. receiving following error when run queue implementation. error info: processed c:\users\388638\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp3\pubsub\web-inf/queue.xml apr 14, 2014 12:14:11 pm com.google.appengine.api.taskqueue.dev.localtaskqueue init info: localtaskqueue initialized apr 14, 2014 12:14:11 pm com.google.appengine.tools.development.apiproxylocalimpl log severe: javax.servlet.servletcontext log: unavailable java.lang.runtimeexception: org.quartz.schedulerconfigexception: unable instantiate class load helper class: org.quartz.simpl.cascadingclassloadhelper cannot cast org.quartz.spi.classloadhelper [see nested exception: java.lang.classcastexception: org.quartz.simpl.cascadingclassloadhelper cannot cast org.quartz.spi.classloadhelper] @ com.google.appengine.api.taskqueue.dev.localtaskqueue.startscheduler(localtaskqueue.java:645) @ com.google.appengine.api.taskqueue.dev.localtaskqueue.start_(localtaskqueue.ja...

javascript - Different positonining of text element of createjs in different browsers -

the slight difference in top position of text object rendered firefox other browsers in createjs while shapes object not show difference. for instance, this.text = new cjs.text("click start", '500 47px hel'); this.text.textalign = "center"; this.text.lineheight = 110; this.text.linewidth = 289; this.text.settransform(119.5, 5); it give different top position relative other graphics surrounding text in firefox or chrome. there way solve issue? if text static (the button text never changes throughout game / app) decide make button image. createjs canvas image anyway, visually there should not difference.

redmine plugins - rails collection_select wrong number of argument error -

i have user_inputs table storing device subscription statuses under column sub_status , these subscription statuses want drop down options under same name. after selecting 1 option drop down want save id of status in equipment_assets table under column_name subscription_status , display status on browser. trying collection_select not working. <div class="pluginesv_formfield"> <%= f.label :subscription_status %><br /> <%= collection_select :sub_status,userinput.all,:id, :subscription_status %></div> this gives error, wrong number of arguments, please me this. here- :sub_status field has drop down options. userinput model these status coming. :id index of sub_status user_inputs table :subscription_status column in equipment_assets table selected ids stored. not getting what's wrong code. please me out this. for table equipment_assets field subscription_status , need update collection_select below: <%= colle...

php - PDO Exception, Duplicate Entry . While I try to re-index my data in magento -

Image
i trying re-index data in magento. indexes working ok except "product attributes", current status stuck on "processing". when try index using magento admin panel, shows below error. and when try re-index data through shell using command " php indexer.php --reindexall ", throws following exception product attributes index process unknown error: exception 'pdoexception' message 'sqlstate[23000]: integrity constraint vio lation: 1062 duplicate entry '163-137-1-74' key 'primary'' in /home/emperorh ome/public_html/lib/zend/db/statement/pdo.php:228 next exception 'zend_db_statement_exception' message 'sqlstate[23000]: inte grity constraint violatio...

php - AJAX live search not working properly -

Image
picture: my ajax live search working right having 1 problem. when enter 'c' shows me result in c character occurs. when click 'ce' no search shows when have word 'certificate'. don't know why happening. appreciated. is there way highlight particular word when moving mouse on it? , when clicked word, should put in input box? php: <?php $getaccount = $_get['getaccountinput']; if($getaccount != '') { $query = oci_parse($con, "select distinct account_type accounts account_type '%".$getaccount."%'"); oci_execute($query); $r = oci_fetch_array($query); if(empty($r)) { echo "no result found"; } while($row = oci_fetch_array($query)) { echo "<a href='#'>"; echo '<font color="white">'....

javascript - Print button not print images but print text document -

Image
i use following java script print button. <script type="text/javascript"> function printform() { var printcontent = document.getelementbyid('<%= panel1.clientid %>'); var windowurl = 'about:blank'; var uniquename = new date(); var windowname = 'print' + uniquename.gettime(); var printwindow = window.open(windowurl, windowname, 'left=50000,top=50000,width=0,height=0'); printwindow.document.write(printcontent.innerhtml); printwindow.document.close(); printwindow.focus(); printwindow.print(); printwindow.close(); } </script> the above code not print images print text document.what can solve problem.plz provide me solution. in case if find difficult see background images printed on document, make sure have option set in ie, if use ie.

sql - mysql timestamp query, select all but first records for a given minute -

i have table stores data snapshots ip cameras take. generally, cameras take multiple snapshots per minute, although 1 of cameras configured take 1 snapshot per minute. i purge items table (and disk), retain according following rules: for first 7 days, images kept anything on 7 days old, keep first snapshot per hour of day anything on 4 weeks, keep first snapshot in 06th, 12th , 18th hour of day anything on 3 months old, keep first snapshot in 12th hour of day. the following current query, works ok, except keeps snapshots taken during first minute of hour. select camera_id, timestamp, frame, filename snapshot_frame ((timestamp < subdate(now(), interval 7 day) , minute(timestamp) != 0) or (timestamp < subdate(now(), interval 4 week) , (hour(timestamp) not in (6, 12, 18) or minute(timestamp) != 0)) or (timestamp ...

python - Extend string to a list inside a list -

list = [ [ ] ] money = int(raw_input("enter total money spent: ")) in program want extend money variable list inside list, when print it, appears [ ["money variable input"] ]. planning on adding other items same element. how can this? thanks. just use "append" method on first element of list. since list multi-dimensional array, first element array, have "append" method. example: list = [ [ ] ] money = 10 list[0].append(money) list prints [[10]]

Convert dynamically generated pdf in jpg with php-imagic -

i'm deserately trying convert pdf files jpeg using imagick. it's working when i'm using syntax : $imagick = new imagick(); $imagick->readimage('file.pdf'); $imagick->writeimage('output.jpg'); but… pdf want convert dynamically generated in pdf using tcpdf. , i'm desesperately trying convert pdf files jpeg using image magick. it's working when i'm using syntax : $imagick = new imagick(); $imagick->readimage('file.pdf'); $imagick->writeimage('output.jpg'); and can't imagine write file each time script sollicited ! idea ?

bash - How do I mark only one selection as TRUE in a dynamic zenity radiolist? -

this code have @ moment - finds files have file extension .sv , lists them in zenity radiolist, however, none of items selected. of course, if change awk '{print "false\n"$0}' awk '{print "true\n"$0}' they'll selected, don't want. test_name=$( find ../tests/ -name '*.sv' | awk '{print "false\n"$0}' | cut -d "/" -f3 | cut -d "." -f1 | zenity --list \ --radiolist \ --title "select test" \ --text "tests..." \ --column "box" \ --column "files" ) #select test via zenity how make first item selected, , rest not? know can done using arrays, suggested this question/answer, require more code. there more elegant way of achieving this? you can amend awk command print "true" if first line processed. can remove cut commands using basename : test_name=$( ...

javascript - ngTable with requirejs - ngTableParams object is not a function -

got bit of problem when using ngtable require js. when try set attributes of ngtableparams object not function though copied code http://bazalt-cms.com/ng-table/example/3 my controller looks this. define(['./module', 'ngtable'], function (controllers) { 'use strict'; controllers.controller('mycontroller', ['$scope', '$rootscope', 'ngtableparams', function ($scope, $rootscope ngtableparams) { $scope.tableparams = new ngtableparams({ page: 1, // show first page count: 10, // count per page sorting: { name: 'asc' // initial sorting } }, { total: data.length, // length of data getdata: function($defer, params) { // use build-in angular filter var ordereddata = params.sorting() ? $filter('orderby')(data, params.orderby()) : data; $defer...

ruby on rails - Devise `find_first_by_auth_conditions` explanation -

this question has answer here: devise `find_first_by_auth_conditions` method explanation 3 answers i having tough time understanding code devise , though i've read documentation , done research. def self.find_first_by_auth_conditions(warden_conditions) conditions = warden_conditions.dup signin = conditions.delete(:signin) where(conditions).where(["lower(username) = :value or lower(email) = :value", {:value => signin.downcase }]).first end please explain components of portion of above method: where(conditions).where(["lower(username) = :value or lower(email) = :value", {:value => signin.downcase }]).first # arg hash, assign variable , downcase x = warden_conditions[:signin].downcase # create duplicate preserve orig c = warden_conditions.dup # delete `:signin` c.delete(:signin) # if email, search email if x =~...