AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Scripts discussion (2)
Goto page Previous  1, 2, 3 ... 41, 42, 43 ... 94, 95, 96  Next
 
Post new topic   This topic is locked: you cannot edit posts or make replies.    AkelPad Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
wallywalters



Joined: 12 Aug 2011
Posts: 6

PostPosted: Thu Jul 12, 2012 3:34 am    Post subject: Reply with quote

FeyFre and Vistor7, my thanks. I'm trying to get them working and learn from them both.
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1915
Location: Poland

PostPosted: Sun Jul 15, 2012 2:40 pm    Post subject: Reply with quote

MapNetDrive.js

Now the script can be run in AkelPad window or directly, in the command line.
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1915
Location: Poland

PostPosted: Sun Jul 15, 2012 3:43 pm    Post subject: Reply with quote

The following picture shows two windows of MapNetDrive.js script.
On the left - the script runs from AkelPad.
On the right - the script runs from command line.
Can someone explain to me why the buttons have a different shape and color?

MapNetDrive.png
Back to top
View user's profile Send private message
FeyFre



Joined: 07 Aug 2007
Posts: 2236
Location: Vinnitsa, Ukraine

PostPosted: Sun Jul 15, 2012 6:29 pm    Post subject: Reply with quote

KDJ, it is probably because of DLLHELL Wink Akelpad.exe have own common controls manifest, where in dependencies requirement of Common controls 6.0 (with nice round corners and other shapes). But Wscript.exe does not have such manifest. Try to create one(borrow somewhere), name it wscript.exe.manifest and put near wscript.exe.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
KDJ



Joined: 06 Mar 2010
Posts: 1915
Location: Poland

PostPosted: Sun Jul 15, 2012 8:06 pm    Post subject: Reply with quote

FeyFre
Excellent, this is what was needed!
I borrowed a manifest from Instructor (AkelPad.exe.manifest).
It works beautifully.
Thank you very much.
Back to top
View user's profile Send private message
FeyFre



Joined: 07 Aug 2007
Posts: 2236
Location: Vinnitsa, Ukraine

PostPosted: Sun Jul 15, 2012 8:33 pm    Post subject: Reply with quote

KDJ, don't forget to rename assembly (name attribute of assemblyIdentity tag). It could provoke unknown side-effects.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
KDJ



Joined: 06 Mar 2010
Posts: 1915
Location: Poland

PostPosted: Mon Jul 16, 2012 8:06 am    Post subject: Reply with quote

FeyFre
What name would be appropriate? Could it be "wscript"?
Back to top
View user's profile Send private message
Surveyor



Joined: 08 Feb 2008
Posts: 147
Location: British Columbia, Canada

PostPosted: Mon Jul 16, 2012 3:28 pm    Post subject: XP Style Hacker - manifest file generator Reply with quote

I have run into similar problems with software (under Win XP SP3) which required a manifest file. You can generate your own using XP Style Hacker, available here:

http://www.softpedia.com/get/System/OS-Enhancements/XP-Style-Hacker.shtml

Its free and simple! The resulting (text) file may be edited using AkelPad, if desired. I believe that the target file should be wscript.exe (Windows\system32 folder under XP).
Back to top
View user's profile Send private message Send e-mail
FeyFre



Joined: 07 Aug 2007
Posts: 2236
Location: Vinnitsa, Ukraine

PostPosted: Mon Jul 16, 2012 4:03 pm    Post subject: Reply with quote

KDJ, I think it will be enough to name it as filename itself(i.e wscript.exe). You can prepend it with vendor name.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
KDJ



Joined: 06 Mar 2010
Posts: 1915
Location: Poland

PostPosted: Mon Jul 16, 2012 7:35 pm    Post subject: Reply with quote

Thank you Gentlemen.
The program which Surveyor gave, generated this file:
wscript.exe.manifest
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
  version="1.0.0.0"
  processorArchitecture="X86"
  name="CompanyName.ProductName.YourApp"
  type="win32"
/>
<description>Your application description here.</description>
<dependency>
  <dependentAssembly>
  <assemblyIdentity
    type="win32"
    name="Microsoft.Windows.Common-Controls"
    version="6.0.0.0"
    processorArchitecture="X86"
    publicKeyToken="6595b64144ccf1df"
    language="*"
  />
  </dependentAssembly>
</dependency>
</assembly>

It looks like a template. You just need to enter own data - name in assemblyIdentity and description.
Back to top
View user's profile Send private message
Visitor7



Joined: 03 Jun 2012
Posts: 88

PostPosted: Tue Jul 17, 2012 2:29 pm    Post subject: Reply with quote

Как лучше определить целое число и вернуть в виде числа?
Пока только так догадался, с кучей излишеств:
if ( (Math.floor(string) == string) && !isNaN(parseInt(string,10)) )
return parseInt(string,10);
Math.floor пустые строки с табуляцией и без переводит в "0", поэтому parseInt проверяю, он на пустые строки дает NaN.
Back to top
View user's profile Send private message
opk44



Joined: 16 Jan 2010
Posts: 545

PostPosted: Tue Jul 17, 2012 3:22 pm    Post subject: Reply with quote

Visitor7
Этот код посчитает строку "0000001111.00000" тоже целым числом (1111). По-моему это не вполне корректно. Или так и задумано?
Back to top
View user's profile Send private message
FeyFre



Joined: 07 Aug 2007
Posts: 2236
Location: Vinnitsa, Ukraine

PostPosted: Tue Jul 17, 2012 4:28 pm    Post subject: Reply with quote

opk44
Ну "0000001111.00000" собственно математическому определению "целое число" соответствует. Также как и и запись 1.5e+1. Другое дело что физики скажут что "0000001111.00000" означает 0000001111 +/- 0.000005 а у них понятие "целого" в таких случаях уже не пляшет.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Visitor7



Joined: 03 Jun 2012
Posts: 88

PostPosted: Tue Jul 17, 2012 7:25 pm    Post subject: Reply with quote

opk44 wrote:
код посчитает строку "0000001111.00000"
Я заметил. Мне нужно входные аргументы скрипта ограничить и в каком виде чел умудрится цифры ввести если удастся - не критично. Главное чтобы скрипт понял их правильно.
FeyFre wrote:
физики скажут что "0000001111.00000" означает 0000001111 +/- 0.000005
В физике результат может быть 1234.123, а погрешность +/-25.4. А другой - с иной. Потом уже усредняют для красоты, статистики и в зависимости от того какая точность преследуется, ну мол напишем так 1200 +/-100, не соврем.
...
Вопрос снимается, я просто не знал что ((" " + 8 + "")/(2 * " " +2 -"")) == 4 а +" " === 0 ))) Зачем бороться с системой если она и так прекрасно работает. Странный язык. Взять тот же Math.floor, почему он кушает -15.6e2, 0x2F, но не кушает -0x2f и 0743, и нахрена нужно опознавание восьмиричной системы если двоичная была бы нужнее, а ее нет.
Back to top
View user's profile Send private message
opk44



Joined: 16 Jan 2010
Posts: 545

PostPosted: Wed Jul 18, 2012 8:13 am    Post subject: Reply with quote

Visitor7 wrote:
нахрена нужно опознавание восьмиричной системы если двоичная была бы нужнее, а ее нет.
Так уж и нет? Зачем же так безапелляционно. Сами же себе противоречите. В примере (parseInt(string,10)) Вы принудительно используете основание 10. С тем же успехом могли бы пользоваться ЛЮБОЙ системой счисления от 2 до 36! Wink

parseInt(numString, [radix]), где radix от 2 до 36.
Просто префиксы позволяют обойтись без второго параметра, лишь для трех оснований: 8, 10 и 16.

Пример:
WScript.Echo(parseInt('1111100111',2)); // "Результат" = 999
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    AkelPad Forum Index -> Plugins All times are GMT
Goto page Previous  1, 2, 3 ... 41, 42, 43 ... 94, 95, 96  Next
Page 42 of 96

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group