Posts

Showing posts from July, 2013

C# create an image that follows the mouse -

i'm trying create program within winform in c# image follow mouse outside application. i have no clue how draw image outside of form, let alone have follow mouse. solution going - create borderless form , have follow mouse - solution not work because cannot move form via code. the mouse needs able click , function independently image. how go doing this? it must without changing way mouse used. set ws_ex_transparent extended styles make form ignore mouse clicks. set topmost true , opacity less 100% make semi-transparent. move form timer. like: public partial class form1 : form { public form1() { initializecomponent(); this.opacity = .5; this.topmost = true; this.backcolor = color.yellow; this.formborderstyle = system.windows.forms.formborderstyle.none; // makes form circular: system.drawing.drawing2d.graphicspath gp = new system.drawing.drawing2d.graphicspath(); gp.addellipse(this...

ruby on rails - font-awesome fa-trash not working in production -

Image
i'm using font-awesome in rails app , fa-trash works on development machine when deploy fa-trash stops working , different icon. other icons work fine in production, it's fa-trash. if use fa-trash-o works fine. here example of 3 icons, show, edit & delete, delete supposed trash can. here code icons <td class="th_icon icon_table"> <a id="show" href="/api#/costings/{{costing.id}}"><i class="fa fa-search-plus fa-lg"></i></a> <a id="edit" href="/api#/costings/{{costing.id}}/edit"><i class="fa fa-edit fa-lg"></i></a> <a id="delete" href="" ng-hide="costing.code == 1" ng-confirm-click="destroy(costing.id)"><i class="fa fa-trash fa-lg"></i></a> i've cleared out assets , re-compiled them & restarted server , cleared out cache in browser, test...

Sending file by wifi in android -

hi want send file direct using wifi. search lot in internet , find p2p wifi connection in developer.android site problem not work on every phone , mean phones support p2p connection can use it. looking way. find android app name zapya sending file android phone phone , work on every phone. can how use wifi send data first try search on google , post question.... here link data transfer between 2 wifi devices

django - How do I inspectdb 1 table from database which Contains 1000 tables -

i got schema contains 1000 tables,and many of them don't need, how can inspectdb tables need? you can in python console, or in *.py file: from django.core.management.commands.inspectdb import command django.conf import settings your_project_dir.settings import databases # replace `your_project_dir` settings.configure() settings.databases = databases command().execute(table_name_filter=lambda table_name: table_name in ('table_what_you_need_1', 'table_what_you_need_2', ), database='default') https://github.com/django/django/blob/master/django/core/management/commands/inspectdb.py#l32

ios - Cropping image to 1:1 and then resizing it -

i having problem in cropping image . my flow : 1)crop image 1:1 (for example , if there image of size 665 x 985 px crop 665 x 665 px ). 2)resize 612 x 612 px same instagram . for code use : uiimage *image = [info objectforkey:uiimagepickercontrolleroriginalimage]; nsdata *d=uiimagepngrepresentation(image); cgfloat pic_crop; nslog(@"size of image(bytes):%lu",(unsigned long)[d length]); nslog(@" original image size :%.2f \n",(float)d.length/1024.0f/1024.0f); nslog(@"original height --->%f",image.size.height); nslog(@"original width --->%f",image.size.width); if (image.size.height > image.size.width) { pic_crop=image.size.width; nslog(@"%f",image.size.width); } else{ pic_crop=image.size.height; nslog(@"%f",image.size.height); } then crop , if height less crop height size or width size ! _previewimage.frame = cgrectmake( _previewimage.frame.origin.x, ...

java - Simple Producer Consumer used to send partition notification using HCATALOG -

i not able receive notifications using hcatalog using jms. wrote simple producer consumer program. apache mq service running in background. able send simple text messages using apachemq. "markpartitionforevent()" not able send event consumer's "onmessage()" call. refered following link : https://cwiki.apache.org/confluence/display/hive/hcatalog+notification please guide import org.apache.hadoop.hive.conf.hiveconf; import org.apache.hadoop.*; import org.apache.hadoop.conf.configuration; import org.apache.thrift.texception; import javax.jms.messageconsumer; import javax.management.*; import org.apache.activemq.activemqconnectionfactory; import org.apache.hadoop.hive.metastore.hivemetastoreclient; import org.apache.hadoop.hive.metastore.api.partitioneventtype; import org.apache.hadoop.hive.metastore.api.partition; import org.apache.hcatalog.common.hcatconstants; import java.util.properties; import javax.jms.*; import javax.jdo.*; import javax.naming.*; impo...

excel - Why is sheet being included in VBA when i've asked for it not to be -

does know why not sheets being excluded defined in code below? seems sheet 'asset' still being included. many thanks sub run_me_to_fix_columns() dim ws worksheet '------------------------------------------------------------------ 'list names of worksheets exclude sub resizingcolumns '------------------------------------------------------------------ const excludesheets string = "control,diva_report,asset" '------------------------------------------------------------------ each ws in activeworkbook.worksheets if iserror(application.match(ws.name, split(excludesheets, ","))) call resizingcolumns(ws) end if next end sub sub resizingcolumns(ws worksheet) ws ws.range("a:az").columnwidth = 10 end = 1 24 numbers = worksheetfunction.count(ws.columns(i)) text = worksheetfunction.counta(ws.columns(i)) - numbers if numbers < text w...

Changing position of scrollbar in Android RecyclerView -

hey wondering if possible change position of scroll bar in android recyclerview. move scroll bar closer right side of display. if point me in right direction link or appreciate because can't find on this. thanks! i have 1 workaround idea, you can add main content layout top , bottom padding (or margin). <framelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:fab="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingtop="4dp" android:paddingbottom="4dp"> then recyclerview without defining styles, this: <android.support.v7.widget.recyclerview android:id="@+id/cardlist" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="vertical"/> and i...

android - Switching between multiple custom markers without tap on marker -

i'm using google maps android api utility library in map project order show several markers in map in clustered way. can't find way switching between multiple custom markers without tap on marker. know solution of this? thanks lot in advance! if getting right, can call following function on desired event switch between markers without clicking. marker1.showinfowindow(); marker2.showinfowindow(); marker3.showinfowindow(); mark right if works .:) p.s: info window can hidden calling hideinfowindow().

android - How to identify character before putting it on EditText? -

while entering text on edit text want should start '#' , later contain [0-9] , [a-z] . if user tries enter first character other '#' should not display on edittext . after '#' if user enters character other [0-9] , [a-z] should not display on edittext . for use case, preferable use inputfilter instead of textwatcher inputfilter filter = new inputfilter() { public charsequence filter(charsequence source, int start, int end, spanned dest, int dstart, int dend) { (int = start; < end; i++) { // need handle condition 1st character should #. if(i == 0) { if(!source.charat(i).equals("#")) return ""; } else if (!character.isletterordigit(source.charat(i))) { return ""; } } return null; } }; myedittext.setfilters(new inputfilter[] { filter }); refer: a...

ruby on rails - How do I get this case statement to work? -

in view, doing this: <% case @post when @post.has_children? %> <% @post.children.each |child| %> <li><%= link_to child.title, post_path(child)%></li> <% end %> <% when @post.has_siblings? %> <% @post.siblings.where.not(id: @post.id).each |sibling| %> <li><%= link_to sibling.title, post_path(sibling)%></li> <% end %> <% when !@post.parent.nil? %> <li><%= link_to @post.parent.title, post_path(@post.parent) %></li> <% else %> </ul> </p> <p> there no related posts. </p> <% end %> basically want want check @post variety of conditions. if has_children? , if has_siblings? , etc. i don't want statement exit if of above true or false. once view loads, should automatically check of these statements. if finds of above true, should execute command right below check....

javascript - JQuery .click(function(){}) works locally but not on the server -

i confused. piece of code works fine should on local server on computer. after uploaded hostgator server, function not being executed anymore, since when set break point on firefox debugger, function not called when clicked on class called deck-title . yet locally, break point work , function called. // when click decks, current deck should change $(document).ready(function() { $(".deck-title").click(function() { var decktitle = $(this).text(); $("#current-deck-span").html(decktitle); if (decktitle !== current_deck_global) { var deckid = getdeckidfromtitle(decktitle); updatedisplayingdeck(current_userid, deckid); } current_deck_global = $(this).text(); }); }); any ideas on click(function() ? mean, every other jquery code worked fine on hostgator server, except one... here <head> in web page: <head> <title></title> <meta charset="utf-8"...

java - Hazelcast not able to read data into my own class object using IMap.get, where data inserted using Memcached text protocol -

i inserting record hazelcast c application using memcached client library api's, record follows: typedef struct _activeclient { char id[25]; int ip; char amethod[16]; }activeclient; now trying reading same record using hazelcast java native api's. here java program. imap < string, memcacheentry > mapinst = client.getmap("hz_memcache_abc_map"); system.out.println("map size:" + mapinst.size()); string key = new string("70826892122991"); memcacheentry tmpvalrec = pvrmapist.get(key); system.out.println("key:" + key + "id:" + tmpvalrec.getvalue()); here tmpvalrec.getvalue() printing record content in single string format. but, want retrive each member value tmpvalrec own java class object. here class class activeclients { string ueid; int ip; string amethod; activeclients() { ueid = ""; ip = 0; amethod = ""; } } pointing me exampl...

tomcat - How to kill a java program with java program -

i have scenario, need kill java process. here scenario: i have web application in web application have implemented listener class below public class mylistener extends servletcontextlistener { java.lang.process ps = null; public void contextinitialized(servletcontextevent arg0) { // excuted when web application executed string command= "cmd.exe start maybatch";// command execute batch program triggers java program ps = runtime.getruntime().exec(command); } public void contextdestroyed(servletcontextevent arg0) { //this part executed when server shutdown happens. // here want close java process triggered when project deployed. if( ps !=null) ps.destroy(); } } } what requirement close java process when tomcat shutting down , start java program when web application deployed. everything working fine till start java process when project deployed. but dont know how close java process triggered when p...

msbi - Running a DFT Based on a condition in SSIS -

i've package need retrieve data mysql table , insert sql server table. i've situation in old data gets modified , client wants dump data large , time consuming...so i've come proposal we'd load yesterday's data on week days , complete dump on weekend...is there possibility of enable/disabling dft based on expression? i've tried using expressions->disable based on datepart(weekday,getdate()) runs complete load irrespective of expression's value regards, vijay create sql task or script task expression, , set result variable. create data flow task. connect 2 arrow (aka precedence constraint) then right-click:edit on arror , choose edit, , in precedence constraint editor choose evaluationoperation: expression value: @@yourvariable= {an expression, such @irowsupdated==true}

mysql - Do i need to connect to database every HTTP request in NodeJS? -

i using locomotivejs(mvc) based on expressjs developing first simple api.. still in learning phase.. using mysql database.. my question is, need initiate connection mysql everytime there's controller request? here's code : songscontroller.show = function() { //this.title = 'locomotive'; console.log("nice imbasss"); var contacts = songsmodel.foo("good"); var dbconnection = dbutilities.connectmysql(); var contactsarr = []; dbconnection.query('select * contacts', function(err, rows, fields) { //console.log(err); console.log(rows); //console.log(fields); //contactsarr = rows; }); dbutilities.endmysql(dbconnection); }; as can notice, everytime songs/show called, connectmysql() called.. doing right? you should connect mysql everytime when fire query mysql , should close connection after because mysql injection may occur third party.

ios - Why view is transparent during transition? -

Image
i have problem. when uiview red uilabel transitioning, has transparent background. when transition has finished has white background? why? how make not transparent background?

C++ integer digits to line by line -

i working project convert integer value each line. example: 23487 output be 2 3 4 8 7 i know code if used string, think better if use integer. my current code using string: #include <iostream> #include <string> using namespace std; int main() { string str("23487"); (int = 0; < str.size(); i++){ cout << str[i] << endl; } system("pause"); return 0; } can me if use int instead of string? for integer values larger 0, can use this: void print(int val) { if (val > 0) { print(val/10); cout << val%10 << endl; } }

c - Initialize array with struct of const data -

my case somehow similar stackoverflow.com/questions/16676973 due lack of knowledge cannot learn essential lesson it... what want achieve loading constant image data memory @ compile time (without knowing size of each image exactly) , array of identifiers of each image can access them time wish within code. ideal way array of pointers beginnings of each image, there question of how determine exact size of each 1 later on. sizeof(imagedatatype) change depending on when call images[i]... (i guess - no. how?) how i'm trying looks this: typedef struct _imagedatatype { uint8_t imageid; uint8_t dataofoneimage[] } imagedatatype; const imagedatatype images [] = { {1,{a, ,l,o,t, ,o,f, ,c,o,n,v,e,r,t,e,d, ,i,m,a,g,e, ,d,a,t,a, ,i,n, ,h,e,x}}, {2,{a, ,l,o,t, ,o,f, ,c,o,n,v,e,r,t,e,d, ,i,m,a,g,e, ,d,a,t,a, ,i,n, ,h,e,x}} //of course, data fake here, illustration purposes, 0x00, 0x0c, etc }; of course, throws error, "too many initializers array ...". tak...

java - Open WebSocket connection with authentication cookie -

i have same issue websockets , cookies in android , , have been trying solve first comment suggested, websocketclient( uri serveruri , draft protocoldraft , map httpheaders , int connecttimeout) using java-websocket , looking @ many other apis such jetty , androidasync . despite unable open websocket connection. i have apache http cookie , , need authenticate myself server websocket. correct way of translating cookie httpheader, or there neat way add entire cookie in authentication when connection websocket? maybe missing obvious.. apologies possible misuses of terms, hope general idea. any appreciated, thank you! so managed solve it, , turned out not cookie actual issue, rather websocket not initialized valid sslcontext. solved rather by: websocketorderclient websocketorderclient = new websocketorderclient(uri, new draft_17(), cmap, timeout); sslcontext sslcontext = null; sslcontext = sslcontext.getinstance( "tls" ); sslcontext.init( null, null, ...

jni - Does not Java create heapdump when native allocation fails -

the jvm started using parameter -xx:+heapdumponoutofmemoryerror. not creating heapdump on outofmemory. does not java create heapdump when native allocation fails? following log: # there insufficient memory java runtime environment continue. # native memory allocation (malloc) failed allocate 1184288 bytes chunk::new # error report file more information saved as: # d:\product\bin\hs_err_pid5876.log java.lang.outofmemoryerror --edit-- the max heap size set 4gb, system ram size 16gb , when ran out of memory using >11gb (shown windows task manager). from discussion @alain.janinm.... think can conclude jvm didn't have enough memory generate heapdump. so, possible creating heapdump had caused jvm use system memory according error java.lang.outofmemoryerror has been thrown. rest of stacktrace indicate happened in native heap. hence allocation failure detected in jni or native method rather in java vm code. (from troubleshooting memory leaks ) that why no h...

ios - How to remove corner radius of the formsheet style UIViewController -

Image
@ibaction func popoverradarchart(sender: uibutton) { let popoverviewcontroller = resulttwopopoverviewcontroller(nibname: "resulttwopopoverviewcontroller", bundle: nil) popoverviewcontroller.modalpresentationstyle = uimodalpresentationstyle.formsheet popoverviewcontroller.modaltransitionstyle = uimodaltransitionstyle.crossdissolve popoverviewcontroller.preferredcontentsize = cgsizemake(540, 622) popoverviewcontroller.view.layer.cornerradius = 0.0 popoverviewcontroller.view.layer.maskstobounds = true presentviewcontroller(popoverviewcontroller, animated: true, completion: nil) } if remove 4 corner radius 0.0. well in resulttwopopoverviewcontroller overide viewwilllayoutsubviews - (void)viewwilllayoutsubviews { [super viewwilllayoutsubviews]; self.view.superview.layer.cornerradius = 0.0; self.view.superview.layer.maskstobounds = no; }

android - Issues with the Material ProgressBar -

i found strange issue material design progressbar in 1 of activities. animation isn't running smoothly shown here: http://gfycat.com/radiantfocusedauk . it's worth mentioning happens 1 of progressbars. others displayed should be. the layout quite simple: <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <textview android:id="@+id/detail_loan_statustext" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:layout_gravity="center_vertical" android:padding="8dp"/> <progressbar android:id="@+id/detail_loan_progress" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vert...

CSS classes and ID's on one row -

i want clean code this: before: .title { text-align:right; width:100px; } to .title { text-align:right; width:100px; } is there website clean code? what you're looking css minifier . minification: definition minification (also minimisation or minimization), in computer programming languages , javascript, process of removing unnecessary characters source code without changing functionality. these unnecessary characters include white space characters, new line characters, comments, , block delimiters, used add readability code not required execute. ~ wikipedia ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ this online minifier want. it's description: online css minifier/compressor. free! provides api. simple quick , fast. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ here's website lists 5 free tools can used clean css, (especially 'dirty' markup ap...

php - How can I set the newline separator for Doctrine-generated code? -

i working on symfony 2 project uses doctrine. development happening on windows why files have \r\n newline separator. however, when adding new properties entity classes , running app/console doctrine:generate:entities doctrine add generated code \n newline separators. results in files inconsistent newline separators. next time open them editor/ide replace \n \r\n , show lines changed though change newline separator. how can tell doctrine should respect newline separators present in file when generating code? why don't wont use unix style newlines? every ide can hadle you. , there no problem windows php implementation handle unix style newlines.

Visual Studio C# MetroFramework MetroButton change Back Color -

i looking possibility change button backcolor on button click or on timer. using metroframework ok; form style set metroform , objects usable. i have found code doesn´t work. using metroframework.forms; using metroframework.drawing; using metroframework.controls; using system.drawing; private void metrobutton1_click(object sender, eventargs e) { //metrobutton1.backcolor = color.green; metrobutton1.backcolor = system.drawing.color.aliceblue; metrobutton1.text = "button click"; //metrobutton1.backcolor.system.drawing.color.darkgray; according source code of metrobutton class ( on github ), there property: private bool usecustombackcolor= false; [defaultvalue(false)] [category(metrodefaults.propertycategory.appearance)] public bool usecustombackcolor { { return usecustombackcolor; } set { usecustombackcolor = value; } } if property false in onpaintbackground(painteventargs e) th...

xamarin.forms - Download a zip file and unzip to internal storage Android Xamarin cross platform app -

is there way download , unzip file remote server using xamarin cross platform application. use pc:storage librray interact files , folders ifolder rootfolder = filesystem.current.localstorage; ifolder folder = await rootfolder.createfolderasync("myapproot\\f1",creationcollisionoption.openifexists); ifile file = await folder.createfileasync("firstfile.txt", creationcollisionoption.replaceexisting); await file.writealltextasync("my content"); this way created folder f1 inside app root folder , creates files firstfile.txt , write comtent it. how can same zip file ? download zip file , unzip contents folder . also how can see folders / files created while running application ? isostorespy kind of tools available xamarin android emulator ? step one, file: xamarin helps downloading file here's download task in case link moves/dies: public static async task<int> createdownloadtask(string url...

Libgdx smooth horizontal scroll images -

Image
i have below setup purchasing items in game: as can see, if have more 3 items user should able scroll see next item. far, have tried use actor 's event touchdrag . there glitch during interaction, won't scroll until finger reach left side of each image.. guys have other solution ? you can use scrollpane actor, has functionality need , can create own ui elements it. add table buttons, widgets , other actors , handle scrolling you.

Hibernate Search Tuple Queries -

i have entity message one-to-many relation entity header. how can create tuple based search query (message.headerkey="foo" , message.headervalue="123") , (message.headerkey="bar" , message.headervalue="456") my current logic match when swap header values in search criteria (message.headerkey="foo" , message.headervalue="456") , (message.headerkey="bar" , message.headervalue="123") how can tuple based query using hibernate search api? this message entity: @entity @table(name="message") @indexed public class messageentity implements serializable { @id @generatedvalue(strategy=generationtype.auto) @column(name="id") private long id; @column(name="message_timestamp") private date timestamp; @column(name="payload") @field(index=index.yes, analyze=analyze.yes, store=store.no) private string payload; @onetomany...

objective c - Symmetric zooming of image within scrollview in iOS -

i new iphone ios development. , want demo zoom in , zoom out (symmetric zooming of image) image within scrollview in ios.this code : in code have taken image view within scrollview(zoomscrollview) , scrollview within scrollview(scrollview_gallery).thanks in advance.. //zoomgalleryviewcontroller.m// scrollview_gallery.backgroundcolor = [uicolor yellowcolor]; scrollview_gallery.delegate = self; scrollview_gallery.pagingenabled = yes; scrollview_gallery.userinteractionenabled = yes; scrollview_gallery.showshorizontalscrollindicator = no; scrollview_gallery.showsverticalscrollindicator = no; [self.view addsubview:scrollview_gallery]; if(ui_user_interface_idiom()==uiuserinterfaceidiomphone) { [scrollview_gallery setcontentsize:cgsizemake(self.view.frame.size.width*[arrayurl count],self.view.frame.size.height)]; } else if(ui_user_interface_idiom()==uiuserinterfac...

javascript - access an element through CSS Path from outside of iframe -

i want access dom element through css path inside iframe. following direct css path: var dompath = "html body div div div div div div div ul li a:contains('parks')"; $(dompath).click(); the above line working fine if opening page without iframe. i want open same page inside iframe , want trigger click on above element outside iframe. have tried in way, not working. $('#scaled_frame').contents().(dompath).click(); how can perform click action outside. best regards, try this: $('#scaled_frame').contents().find(dompath).click();

groovy - Where to find a NotNull java annotation -

i searched @notnull java annotation , found 1 javax. tried use ran same issues described here . in short: need set stuff working - don't need (i in plain java/groovy context, no javaee). there alternatives mentioned annotation work standalone, find those? oval can this. download jar http://mvnrepository.com/artifact/net.sf.oval/oval/1.31 , @ documentation here http://oval.sourceforge.net/ for example: import net.sf.oval.constraint.maxlength; import net.sf.oval.constraint.notempty; import net.sf.oval.constraint.notnull; public class request { @notnull @notempty @maxlength(value = 30) private string id; //.....getters setters...... } above pojo /** * method returns if valid request or not */ private boolean isvalid(request request) { list<constraintviolation> violations = validator.validate(request); if (violations.size() > 0) { return false; } else { return true; } } and validation above. you can find many more examples online.

c# - DLL importation -

i have soft (using c#.net) able flash 2 microcontroller (cpu/pic). have vb6 dll, unfortunately can't use in vs. found development kit wrotte in cpp this kit contain: a file flasher.lib -> can't see source code // flasher.exp -> can't see source code // dll_interface.bas sample dll_interface.bad : option explicit 'dll function declarations declare function setcom lib "st10flasher.dll" (byval portname$, byval comspeed long) long declare function loadfile lib "st10flasher.dll" (byval filename$, byref fsize long) long declare function initmonitor lib "st10flasher.dll" (byval device any) long declare function programflash lib "st10flasher.dll" () long declare function geterror lib "st10flasher.dll" (byval bufferforstatus any) long // basicinterface.h sample basicinterface.h #ifndef _basic_interface_h #define _basic_interface_h #ifdef __cplusplus extern "c" { #endif #ifndef st1...

Merge a two way relation in the same table in SQL Server -

current data id | name1 | name2 <guid1> | xmind | mindnode <guid2> | mindnode | xmind <guid3> | avast | hitman pro <guid4> | hitman pro | avast <guid5> | pplive | hola! <guid6> | zenmate | hola! <guid7> | hola! | pplive <guid8> | hola! | zenmate required output id1 | id2 | name1 | name2 <guid1> | <guid2> | xmind | mindnode <guid3> | <guid4> | avast | hitman pro <guid5> | <guid7> | pplive | hola! <guid6> | <guid8> | hola! | zenmate these relations between apps. want show avast , hitman has relation in view not need show in "direction" have relation. it's given in view relation goes both ways. edit: seems example simple. solution doesn't work more data. declare @a table (id int, name1 varchar(50), name2 varchar(50)) insert @a values ( 1, 'xmind...

ios - Converting number to format with NSNumberFormatter -

how can convert number 4273095782 number 4 273 095 782 nsnumberformatter? i use diode not it nsnumberformatter *formatter = [[nsnumberformatter alloc] init]; formatter.numberstyle = kcfnumberformatterdecimalstyle; formatter.maximumintegerdigits = 3; formatter.minimumfractiondigits = 3; formatter.groupingseparator = @" "; formatter.decimalseparator = @" "; nsstring *formattednumber = [formatter stringfromnumber:p]; you need use 2 properties : setgroupingsize: last 3 digits , setsecondarygroupingsize: other digits: the complete implementation go this: nsinteger integer = 4273095782; nsnumberformatter * formatter = [nsnumberformatter new]; [formatter setnumberstyle:nsnumberformatterdecimalstyle]; [formatter setgroupingsize:3]; [formatter setsecondarygroupingsize:3]; [formatter setgroupingseparator:@" "]; nsstring * threeseparated = [formatter stringfromnumber:@(integer)]; nslog(@"threeseparated: %@", threeseparated); outpu...

nginx - What would be the best strategy to take a RTP stream and send it to an RTMP server? -

i'm receiving rtp/udp hardware encoder, have tried ffmpeg, takes input , outputs stream flv (it's being sent nginx, nginx-rtmp-module). i'm not able play stream smoothly once it's received nginx, frames broken or lost, etc. i think cpu slow format change (flv) and/or ffmpeg missing lot of rtp packets. ideas?

opencart - Clickin on Information link brings up blank page -

none of information links work, when click on them shows blank page. url right , id numbers right eg. ?route=information/information&information_id=4. strangely when click on terms , conditions link when completing order takes me correct page shows content , none of formatting of home page. if click on same link footer shows blank. have activated logging , no errors appear, have checked footer.tpl , looks fine. have ideas? thanks the blank page error, should visible in error log (most extension/theme you've installed). if doesn't show in opencart error log under system > error logs need check out servers php error log. t&c page showing because doesn't load through same method 1 in footer, , supposed simplistic page. however, should load in popup not change browser page. sounds theme screwing up

ngCordova sqlite plugin database write error on Android -

i've got project using cordova (ionic framework) ngcordova , cordovasqlite plugin. plugin installed, js has been added html, write_external_storage permission added androidmanifest, , following 2 lines in config.xml <preference name="androidpersistentfilelocation" value="compatibility" /> <preference name="androidextrafilesystems" value="sdcard,cache" /> however, when run example code: $cordovasqlite.opendb({name: "wt.db"}); $cordovasqlite.execute(db, "create table if not exists people (id integer primary key, firstname text, lastname text)"); i error e/cutils(1910): failed mkdirat(/storage/usbdisk0/android): read-only file system i checked on android device (s3 running aokp), , have empty /storage/usbdisk0 no android folder in there, , superuser can't create it. have /storage/sdcard0 , /storage/sdcard1 , /storage/emulated (with 0 , legacy inside linked internal sd card). i'm assuming p...

php - Laravel Auth and Session not working on Live Server -

session controller: session::flash('flash_notice', 'registered ,please check email'); in view @if (session::has('message')) {{ session::get('message') }} @endif in view session data not dispalying on live server auth auth::check() , auth::user() gives me false , null on liver server but on localhost working fine. plz me out here from sounds of sessions not being set , being regenerated each request. (check session storage on live server) ensure session config file correct, domain, path , secure options.

angularjs - How do I use a dropdown box as a column header filter in ng-grid / ui-grid? -

i using ui-grid (angular's fast grid system). if set 'enablefiltering: true', text box under each column header can use filter grid, awesome. need or of these dropdown boxes instead of text boxes, how achieve this? e.g. 1 column can have values 'ok', 'nok' , 'abb.'. allow user filter column based on 3 options. you should write custom headercelltemplate in columndefs .

Brackets and assignment inside of php's IF -

question: code 1 , code 2 has got 1 difference - brackets. i not why 1st causes error 2nd not. code 1: if ( $response = $myobject->response($request) && $response2 = $myobject->response($response) // php notice: undefined variable: response ) code 2: if ( ($response = $myobject->response($request)) && $response2 = $myobject->response($response) // ok ) && operator has higher precedence = operator. the brackets change order of evaluation desire, expressions in brackets evaluated first(as in math).

How to Decrypt and Play CENC protected contents in DASH? -

i have mpd clip supports cenc,how decrypt , play without using specific drm engine??is there decryption algorithm available decrypt aes ctr 128 bit?if used decrypt mpeg-dash content?there third party libraries available in net nacl,openssl,crypto++,which can aes ctr 128 decryption.can use 1 of them decrypt dash content(cenc supported) ?? dash videos protected using cenc can played using many different drm technologies. primary factors need care are: the player used must support chosen drm technology. of popular browsers, internet explorer 11 supports playready , chrome supports widevine. non-browser platforms, various 3rd party players available. the video must contain metadata allows drm technology recognize actions needed in order decrypt video (most importantly, id of encryption key , url acquire from). there must service running provide decryption key player on demand, after validating user authorized view video. generally, key embedded in data structure called l...

java - Can't load native library on other systems -

i'm developing application makes use of libjahspotify . program running on desktop (windows 7), when attempting run on laptop (windows 8.1) or on other intel nuc (windows 7) getting below error: exception in thread "main" java.lang.unsatisfiedlinkerror: c:\temp\jahspotify.dll: can't find dependent libraries @ java.lang.classloader$nativelibrary.load(native method) @ java.lang.classloader.loadlibrary0(classloader.java:1929) @ java.lang.classloader.loadlibrary(classloader.java:1814) @ java.lang.runtime.load0(runtime.java:809) @ java.lang.system.load(system.java:1083) @ jahspotify.jahspotifynativeloader.<init>(jahspotifynativeloader.java:90) @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:62) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:45) @ java.lang.r...

actionscript 2 - How to disable a HIT area in AS2? -

how disable hit area (a movieclip instance name "hit") in as2? please note don't want hide hit area after hitted. needed code disable or remove instance name other objects cannot hit again. if want instance c1 disabled after being touched, can do: c1.onenterframe = function():void { if (this.hittest(anothermovieclip)) { delete this.onenterframe; } } the hittest can't occur after onenterframe function deleted .

MySQL UPDATE not working when text similar -

update: looks mysql ignores trailing space on query 'media services ' i have following code: select * table company = 'media services ' this brings 132 rows ( note space @ end of company name ). need remove space, have tried using following code: update table set company = 'media services' company = 'media services ' the output 0 rows affected - trying understand why might be? any ideas , suggestions don't want manually change 132 records. not sure try using like operator instead like update table set company = 'media services' company 'media services%' per latest comment, it's strong guess there no trailing spaces in company value as. it's when where company = 'media services ' ; ignores trailing space , gives matched result. so essentially, update never happens since there nothing update , update says 0 rows affected .

c++ - Qt/QML application crashes at start-up in Debug Mode -

i'm using qt 5.3 mingw on windows , writing application qt/qml. sometimes, crash happens @ start-up when run project in debug mode , trying debug code. the inferior stopped because received signal operating system is there problem qml or else? stack when error happens. 0 qscopedpointer<qobjectdata, qscopedpointerdeleter<qobjectdata> >::data 143 0x9d2250c 1 qgetptrhelper<qscopedpointer<qobjectdata> > 941 0x99e1cc7 2 qopenglcontext::d_func 148 0x9d21f9b 3 qopenglcontext::isvalid 596 0x99e05d1 4 glacquirecontext::glacquirecontext 75 0x1af7ec21 5 qquickcontext2dtexture::paint 247 0x1aef2b79 6 qquickcontext2dtexture::event 366 0x1aef34a1 7 qapplicationprivate::notify_helper 3500 0x217eded3 8 qapplication::notify 2953 0x217eb985 9 qcoreapplication::notifyinternal 935 0x6b929f96 10 qcoreapplication::sendevent 237 0x6b9cf2db 11 qcoreapplic...

php - How to Fix Syntax error in Wordpress Blog for a theme -

i new programming , while trying remove footer message site, coding went wrong , getting error message in site. parse error: syntax error, unexpected t_class in g:\inetpub\vhosts\socialwebarena.com\httpdocs\wp-content\themes\spacious\inc\functions.php on line 440 /**************************************************************************************/ add_action( 'spacious_footer_copyright', 'spacious_footer_copyright', 10 ); /** * function show footer info, copyright information */ if ( ! function_exists( 'spacious_footer_copyright' ) ) : function spacious_footer_copyright() { $site_link = '<a href="' . esc_url( home_url( '/' ) ) . '" title="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '" ><span>' . get_bloginfo( 'name', 'display' ) . '</span></a>'; //$wp_link = '<a href="'.esc_url( 'http://wordpress.o...

knockout.js - Durandal activationData nested in widget -

i'm creating durandal widget , works fine. question activationdata. seems infinitely nested , have no idea why. if inspect settings argument passed inside activate , drill down activationdata , object keeps being nested within itself. idea why? it's not 'infinitely nested' referencing each other in called circular reference in javascript. long don't try tojson() should fine, it's common practice. take parent / child relationship example - parent - child child - parent a parent has child has parent. no biggie.

javascript - Highcharts gauge is render before the data is fetched by json -

i have came across strange problem. have web page 2 highcharts gauge module , retrieving data using json php script. json looks [{"pid":"1019","date":"15-10-2014","time":"02:52:36","temperature":"31","humidity":"65"}] 1) problem is, during first iteration when data retried isn't reflected @ module. [image] 2) during second iteration of data data displayed module there no color highlight and 3) during third iteration onwards module reflects data color highlight. i think problem due async behavior of json. not sure it, newbie web programming. javascript following var point, temperature, humidity, pressure, windspeed, winddirection, light, rainfall, elevation, lat, lang, bvolt, bcurrent, svolt, scurrent, temp; $.getjson("http://openweather.in/localpublish/livedata.php", function(data) { console.log(data); temperature = parsefloat(data[0].t...